/* Tarea - Chores App Styles */

/* Base styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    background: #f5f5f5;
}

h1 {
    color: #333;
    margin-bottom: 5px;
}

.subtitle {
    color: #666;
    margin-bottom: 20px;
}

/* User selector */
.user-selector {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-selector select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
}

.user-selector button {
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.user-selector button:hover {
    background: #2980b9;
}

/* Chore list */
.chore-list {
    list-style: none;
    padding: 0;
}

.chore-item {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chore-name {
    font-weight: 600;
}

.chore-link {
    color: #333;
    text-decoration: none;
}

.chore-link:hover {
    color: #3498db;
    text-decoration: underline;
}

.chore-date {
    color: #666;
    font-size: 14px;
}

.chore-meta-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 4px;
}

.chore-member {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #495057;
}

.chore-item-highlight {
    border-left: 4px solid #2ecc71;
    background: #f8fff8;
}

.chore-item-other {
    background: #f0f0f0;
    opacity: 0.85;
}

.btn-snag {
    background: #9b59b6;
    color: white;
}

.btn-snag:hover {
    background: #8e44ad;
}

.btn-early {
    background: #3498db;
    color: white;
}

.btn-early:hover {
    background: #2980b9;
}

/* Card with status bar layout */
.chore-card-item {
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chore-card-item.chore-item-highlight {
    border-left: 4px solid #2ecc71;
}

.chore-card-item.chore-item-other {
    background: #f8f8f8;
    opacity: 0.85;
}

.chore-card-item.chore-item-completed {
    opacity: 0.7;
}

.chore-status-bar {
    padding: 6px 15px;
    background: #bdc3c7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.status-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
}

.status-bar-new {
    background: #3498db;
}

.status-bar-available {
    background: #2ecc71;
}

.status-bar-completed {
    background: #95a5a6;
}

.chore-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
}

.chore-card-footer {
    padding: 8px 15px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.detail-link {
    font-size: 12px;
    color: #3498db;
    text-decoration: none;
    padding: 5px 12px;
    border: 1px solid #3498db;
    border-radius: 4px;
    display: inline-block;
}

.detail-link:hover {
    background: #3498db;
    color: white;
    text-decoration: none;
}

.section-title {
    font-size: 16px;
    color: #666;
    margin: 25px 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-title:first-of-type {
    margin-top: 0;
}

.chore-actions {
    display: flex;
    align-items: center;
}

.chore-actions form {
    margin: 0;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-complete {
    background: #2ecc71;
    color: white;
}

.btn-complete:hover {
    background: #27ae60;
}

/* Status badges */
.status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-new {
    background: #3498db;
    color: white;
}

.status-available {
    background: #2ecc71;
    color: white;
}

.status-completed {
    background: #95a5a6;
    color: white;
}

.status-none {
    background: #bdc3c7;
    color: #666;
}

/* Empty state */
.empty {
    color: #999;
    text-align: center;
    padding: 40px;
}

/* Messages */
.messages {
    margin-bottom: 20px;
}

.message {
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.message-success {
    background: #d4edda;
    color: #155724;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
}

.message-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Page header with title and action */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.page-header h1 {
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.inline-form {
    display: inline;
    margin: 0;
}

/* More button styles */
.btn-primary {
    background: #3498db;
    color: white;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

/* Form styles */
.form-container {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="time"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.form-fieldset {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-fieldset legend {
    font-weight: 600;
    padding: 0 10px;
    color: #333;
}

.field-help {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.checkbox-label:hover {
    background: #e9ecef;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Chore card in management view */
.chore-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.chore-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.chore-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #eee;
}

.chore-info {
    flex: 1;
}

.chore-meta {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

.chore-kind {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    text-transform: capitalize;
}

.chore-points {
    color: #3498db;
    font-size: 12px;
    font-weight: 600;
}

.chore-days-away {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.days-today {
    background: #2ecc71;
    color: white;
}

.days-soon {
    background: #f39c12;
    color: white;
}

.days-past {
    background: #85c1e9;
    color: #1a5276;
}

/* Breadcrumb navigation */
.breadcrumb {
    margin-bottom: 15px;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.chore-description {
    color: #666;
    font-size: 14px;
    margin-top: 8px;
}

.chore-schedule {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.schedule-info {
    display: flex;
    gap: 6px;
    align-items: center;
}

.schedule-day {
    font-weight: 600;
    color: #333;
}

.schedule-time {
    color: #666;
    font-size: 14px;
}

.rotation-members {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.member-badge {
    background: #3498db;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.no-schedule {
    color: #999;
    font-style: italic;
}

.chore-assignment-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Detail page styles */
.detail-header {
    margin-bottom: 15px;
}

.detail-header h1 {
    margin-bottom: 8px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.detail-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.detail-card-title {
    font-size: 14px;
    text-transform: uppercase;
    color: #666;
    margin: 0 0 15px 0;
    letter-spacing: 0.5px;
}

.detail-row {
    margin-bottom: 12px;
}

.detail-label {
    font-weight: 600;
    color: #555;
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

.detail-value {
    color: #333;
}

.member-next {
    background: #27ae60 !important;
    border: 2px solid #1e8449;
}

.member-next-large {
    font-size: 18px;
    padding: 10px 20px;
    background: #27ae60;
    color: white;
    border-radius: 20px;
}

.next-member-display {
    text-align: center;
    padding: 10px 0;
}

.empty-small {
    color: #999;
    font-style: italic;
    margin: 0;
}

/* Page navigation */
.page-nav {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.page-nav a {
    color: #3498db;
    text-decoration: none;
}

.page-nav a:hover {
    text-decoration: underline;
}

/* Leaderboard */
.leaderboard {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.leaderboard-member {
    padding: 4px 12px;
    background: #e9ecef;
    border-radius: 16px;
    font-size: 14px;
    color: #495057;
}

.leaderboard-you {
    background: #3498db;
    color: white;
    font-weight: 600;
}

/* ===========================================
   Mobile Responsive Styles
   =========================================== */
@media (max-width: 640px) {
    /* Container & Margins */
    body {
        margin: 12px auto;
        padding: 0 12px;
    }

    /* Page Header - Stack Vertically */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
    }

    .header-actions .btn,
    .header-actions .inline-form {
        width: 100%;
    }

    .header-actions .inline-form .btn {
        width: 100%;
    }

    .header-actions .btn {
        text-align: center;
    }

    /* User Selector - Stack Vertically */
    .user-selector form {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .user-selector select {
        width: 100%;
        margin-right: 0;
    }

    .user-selector button {
        width: 100%;
    }

    /* Chore Cards - Stack Content & Actions */
    .chore-card-body {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .chore-actions {
        width: 100%;
    }

    .chore-actions .btn,
    .chore-actions form {
        width: 100%;
    }

    .chore-actions .btn {
        width: 100%;
    }

    /* Form Layout - Single Column */
    .form-row {
        flex-direction: column;
    }

    .form-container {
        padding: 15px;
    }

    .checkbox-group {
        flex-direction: column;
        gap: 10px;
    }

    .checkbox-label {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    /* Touch Targets - Larger Buttons */
    .btn {
        padding: 12px 16px;
        font-size: 16px;
    }

    .btn-small {
        padding: 10px 14px;
        font-size: 14px;
    }

    /* Input Fields - Prevent iOS Zoom */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
    }

    /* Detail Grid - Single Column */
    .detail-grid {
        grid-template-columns: 1fr;
    }

    /* Status Bar Text - Slightly Larger */
    .status-label,
    .status-time {
        font-size: 12px;
    }

    /* Breadcrumb */
    .breadcrumb {
        margin-bottom: 10px;
    }

    /* Section Titles */
    .section-title {
        margin: 20px 0 10px 0;
    }
}
