/* =========================================
   30-Day Haversack Challenge — Styles
   MonardX Design System
   ========================================= */

:root {
    --ch-navy: #12153D;
    --ch-violet: #6C63FF;
    --ch-violet-hover: #5a52e0;
    --ch-green: #1EC86A;
    --ch-green-dark: #17a356;
    --ch-white: #FFFFFF;
    --ch-bg: #F5F6FA;
    --ch-border: #E2E4ED;
    --ch-text: #12153D;
    --ch-text-secondary: #6B7094;
    --ch-error: #dc3545;
    --ch-error-bg: #fdf0f0;
    --ch-success-bg: #f0fdf4;
    --ch-shadow: 0 2px 12px rgba(18, 21, 61, 0.06);
    --ch-radius: 12px;
    --ch-radius-sm: 8px;
}

/* ---- LANDING PAGE ---- */

.challenge-landing {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ch-bg);
    padding: 3rem 1.5rem;
}

.challenge-landing-card {
    background: var(--ch-white);
    border-radius: 16px;
    box-shadow: var(--ch-shadow);
    max-width: 480px;
    width: 100%;
    padding: 3rem 2.5rem;
    text-align: center;
}

.challenge-landing-card h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--ch-navy);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.challenge-landing-card p {
    color: var(--ch-text-secondary);
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.challenge-google-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--ch-white);
    color: var(--ch-navy);
    border: 2px solid var(--ch-border);
    border-radius: var(--ch-radius-sm);
    padding: 12px 28px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.challenge-google-btn:hover {
    border-color: var(--ch-violet);
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.15);
}

.challenge-google-btn img {
    width: 20px;
    height: 20px;
}

/* ---- DASHBOARD ---- */

.dash-header {
    margin-bottom: 1.5rem;
}

.dash-welcome {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--ch-navy);
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.dash-stats {
    color: var(--ch-text-secondary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
}

.dash-progress-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
}

.dash-progress-bar {
    flex: 1;
    height: 10px;
    background: var(--ch-border);
    border-radius: 5px;
    overflow: hidden;
}

.dash-progress-fill {
    height: 100%;
    background: var(--ch-green);
    border-radius: 5px;
    transition: width 0.4s ease;
}

.dash-progress-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    color: var(--ch-navy);
    font-size: 0.9rem;
    min-width: 40px;
    text-align: right;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 2rem;
}

.dash-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    border-radius: var(--ch-radius);
    text-decoration: none;
    text-align: center;
    min-height: 100px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.dash-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(18, 21, 61, 0.1);
}

.dash-cell-day {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.dash-cell-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    line-height: 1.3;
    opacity: 0.85;
}

/* Completed cell */
.dash-cell-completed {
    background: var(--ch-green);
    color: var(--ch-white);
}

.dash-cell-completed .dash-cell-day {
    color: var(--ch-white);
}

.dash-cell-check {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.85rem;
    color: var(--ch-white);
}

/* Current cell */
.dash-cell-current {
    background: var(--ch-white);
    border: 2px solid var(--ch-violet);
    color: var(--ch-navy);
}

.dash-cell-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    background: var(--ch-violet);
    color: var(--ch-white);
    border-radius: 4px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Unlocked cell */
.dash-cell-unlocked {
    background: var(--ch-white);
    border: 1px solid var(--ch-border);
    color: var(--ch-navy);
}

/* Locked cell */
.dash-cell-locked {
    background: var(--ch-bg);
    border: 1px solid var(--ch-border);
    color: #ccc;
    cursor: default;
}

.dash-cell-locked:hover {
    transform: none;
    box-shadow: none;
}

.dash-cell-lock {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.75rem;
}

.dash-continue {
    text-align: center;
    margin-bottom: 1.5rem;
}

.dash-scrap-summary {
    text-align: center;
    color: var(--ch-text-secondary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.dash-download-link {
    text-align: center;
    margin-bottom: 1.5rem;
}

.dash-download-link a {
    color: var(--ch-violet);
    text-decoration: underline;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
}

.dash-download-link a:hover {
    color: var(--ch-violet-hover);
}

/* ---- DAY PAGE ---- */

.day-top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.day-back-link {
    color: var(--ch-violet);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}

.day-back-link:hover {
    text-decoration: underline;
}

/* Collapsible calendar */
.day-calendar-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--ch-bg);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-sm);
    padding: 8px 16px;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--ch-navy);
    font-weight: 600;
    width: 100%;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.day-calendar-toggle:hover {
    background: var(--ch-border);
}

.day-calendar-toggle .arrow {
    transition: transform 0.2s;
    font-size: 0.7rem;
}

.day-calendar-toggle.open .arrow {
    transform: rotate(180deg);
}

.day-calendar-grid {
    display: none;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 1rem;
    padding: 12px;
    background: var(--ch-bg);
    border-radius: var(--ch-radius-sm);
    border: 1px solid var(--ch-border);
}

.day-calendar-grid.open {
    display: grid;
}

.day-cal-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    border-radius: 6px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    min-height: 32px;
}

.day-cal-cell-done {
    background: var(--ch-green);
    color: var(--ch-white);
}

.day-cal-cell-current {
    background: var(--ch-violet);
    color: var(--ch-white);
}

.day-cal-cell-unlocked {
    background: var(--ch-white);
    color: var(--ch-navy);
    border: 1px solid var(--ch-border);
}

.day-cal-cell-locked {
    background: var(--ch-bg);
    color: #ccc;
    cursor: default;
}

/* Day progress bar */
.day-progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--ch-text-secondary);
}

.day-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--ch-border);
    border-radius: 3px;
    overflow: hidden;
}

.day-progress-fill {
    height: 100%;
    background: var(--ch-green);
    border-radius: 3px;
}

/* Content section */
.day-meta {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ch-violet);
    margin-bottom: 0.5rem;
}

.day-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--ch-navy);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.day-time {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--ch-text-secondary);
    margin-bottom: 1.5rem;
}

.day-briefing {
    font-family: 'DM Sans', sans-serif;
    color: var(--ch-text);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.day-briefing p {
    margin-bottom: 1rem;
}

.day-briefing strong {
    color: var(--ch-navy);
}

/* Activity section */
.activity-section {
    background: var(--ch-bg);
    border-radius: var(--ch-radius);
    padding: 2rem;
    margin-bottom: 2rem;
}

.activity-section h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--ch-navy);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.activity-prompt {
    font-family: 'DM Sans', sans-serif;
    color: var(--ch-text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    font-style: italic;
}

.activity-section label {
    display: block;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    color: var(--ch-navy);
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.activity-section input[type="text"],
.activity-section textarea,
.activity-section select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--ch-text);
    background: var(--ch-white);
    box-sizing: border-box;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.activity-section input[type="text"]:focus,
.activity-section textarea:focus,
.activity-section select:focus {
    outline: none;
    border-color: var(--ch-violet);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.activity-section textarea {
    min-height: 120px;
    resize: vertical;
}

/* Radio buttons */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    accent-color: var(--ch-violet);
}

/* Scrap row */
.scrap-row {
    margin-bottom: 14px;
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-sm);
    background: var(--ch-white);
    padding: 12px;
}

.scrap-row-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scrap-row-fields textarea {
    min-height: 60px;
    margin-bottom: 0;
}

.scrap-row-fields .scrap-source-input {
    margin-bottom: 0;
}

.scrap-remove-btn {
    background: none;
    border: none;
    color: var(--ch-error);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px 0;
    text-align: left;
}

.scrap-remove-btn:hover {
    text-decoration: underline;
}

/* Image upload controls */
.scrap-image-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.scrap-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--ch-bg);
    border: 1px dashed var(--ch-border);
    border-radius: var(--ch-radius-sm);
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ch-violet);
    transition: border-color 0.2s, background 0.2s;
    white-space: nowrap;
}

.scrap-upload-btn:hover {
    border-color: var(--ch-violet);
    background: rgba(108, 99, 255, 0.04);
}

.scrap-file-input {
    display: none;
}

.scrap-image-controls .scrap-image-url {
    flex: 1;
    min-width: 160px;
    padding: 6px 10px;
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* Image preview */
.scrap-image-preview {
    position: relative;
}

.scrap-image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    border: 1px solid var(--ch-border);
    margin-top: 4px;
}

.scrap-image-remove-btn {
    display: inline-block;
    margin-top: 4px;
    background: none;
    border: none;
    color: var(--ch-error);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 2px 0;
}

.scrap-image-remove-btn:hover {
    text-decoration: underline;
}

/* Saved scrap images */
.scrap-image-display {
    margin-top: 8px;
}

.scrap-image-display img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid var(--ch-border);
}

.review-scrap-item .scrap-image-display img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 6px;
}

/* Existing scraps display */
.existing-scraps {
    margin-bottom: 1.5rem;
}

.existing-scrap-item {
    background: var(--ch-white);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-sm);
    padding: 10px 14px;
    margin-bottom: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
}

.existing-scrap-item .scrap-source {
    color: var(--ch-text-secondary);
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Scrap count */
.scrap-count {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--ch-text-secondary);
    margin-bottom: 1rem;
}

/* Review scraps (read-only) */
.review-scraps {
    margin-bottom: 1.5rem;
}

.review-scrap-item {
    background: var(--ch-white);
    border-left: 3px solid var(--ch-violet);
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: 0 var(--ch-radius-sm) var(--ch-radius-sm) 0;
}

.review-scrap-item .scrap-day {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ch-violet);
    text-transform: uppercase;
}

.review-scrap-item .scrap-content {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--ch-text);
    margin-top: 4px;
}

/* Arc brainstorm ideas */
.idea-row {
    background: var(--ch-white);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-sm);
    padding: 14px;
    margin-bottom: 10px;
}

.idea-row input[type="text"] {
    margin-bottom: 0.5rem;
}

.idea-row textarea {
    min-height: 60px;
    margin-bottom: 0;
}

/* Buttons */
.challenge-btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--ch-violet);
    color: var(--ch-white);
    border: none;
    border-radius: var(--ch-radius-sm);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.challenge-btn:hover {
    background: var(--ch-violet-hover);
}

.challenge-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.challenge-btn-secondary {
    background: transparent;
    color: var(--ch-violet);
    border: 2px solid var(--ch-violet);
}

.challenge-btn-secondary:hover {
    background: rgba(108, 99, 255, 0.05);
}

.challenge-btn-green {
    background: var(--ch-green);
}

.challenge-btn-green:hover {
    background: var(--ch-green-dark);
}

.challenge-btn-add {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px dashed var(--ch-border);
    border-radius: var(--ch-radius-sm);
    padding: 8px 16px;
    color: var(--ch-violet);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s;
    margin-bottom: 1rem;
}

.challenge-btn-add:hover {
    border-color: var(--ch-violet);
}

/* Complete button */
.challenge-complete-btn {
    display: inline-block;
    padding: 14px 40px;
    background: var(--ch-green);
    color: var(--ch-white);
    border: none;
    border-radius: var(--ch-radius-sm);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.challenge-complete-btn:hover {
    background: var(--ch-green-dark);
}

.challenge-complete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Message divs (inline, NO alert()) */
.challenge-msg {
    padding: 12px 16px;
    border-radius: var(--ch-radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: none;
}

.challenge-msg-success {
    background: var(--ch-success-bg);
    color: #166534;
    border: 1px solid #bbf7d0;
}

.challenge-msg-error {
    background: var(--ch-error-bg);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.challenge-msg.visible {
    display: block;
}

/* Bottom navigation */
.day-bottom-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--ch-border);
}

.day-bottom-nav a {
    color: var(--ch-violet);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}

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

/* ---- LOCKED PAGE ---- */

.locked-page {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ch-bg);
    padding: 3rem 1.5rem;
}

.locked-card {
    background: var(--ch-white);
    border-radius: 16px;
    box-shadow: var(--ch-shadow);
    max-width: 480px;
    width: 100%;
    padding: 3rem 2.5rem;
    text-align: center;
}

.locked-card h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--ch-navy);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.locked-card p {
    color: var(--ch-text-secondary);
    font-family: 'DM Sans', sans-serif;
    margin-bottom: 1.5rem;
}

.locked-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ---- COMPLETE PAGE ---- */

.complete-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ch-bg);
    padding: 3rem 1.5rem;
}

.complete-card {
    background: var(--ch-white);
    border-radius: 16px;
    box-shadow: var(--ch-shadow);
    max-width: 560px;
    width: 100%;
    padding: 3rem 2.5rem;
    text-align: center;
}

.complete-card h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--ch-navy);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.complete-card p {
    color: var(--ch-text-secondary);
    font-family: 'DM Sans', sans-serif;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.complete-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

.complete-stat {
    text-align: center;
}

.complete-stat-num {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--ch-violet);
}

.complete-stat-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--ch-text-secondary);
}

/* ---- RESPONSIVE ---- */

@media (max-width: 768px) {
    .dash-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .day-calendar-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .scrap-row {
        flex-direction: column;
    }

    .activity-section {
        padding: 1.5rem;
    }

    .complete-stats {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .dash-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dash-cell {
        min-height: 80px;
        padding: 10px 6px;
    }

    .challenge-landing-card,
    .locked-card,
    .complete-card {
        padding: 2rem 1.5rem;
    }

    .day-bottom-nav {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}
