/**
 * Program Page Card Layout Styles
 * Uses theme colors from theme.json
 */

/* CSS Color Variables from Theme */
:root {
    --theme-action: #EAC81F;
    --theme-action-hover: #BB9E11;
    --theme-elevated: #13263A;
    --theme-elevated-light: #1f3a52;
    --theme-surface: #F2F2F2;
    --theme-text-dark: #0D0D0D;
    --theme-text-muted: #4D4D4D;
}

/* Week Container */
.program-weeks {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 30px;
}

.program-week-item {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.program-week-item.locked {
    opacity: 0.7;
    background: var(--theme-surface);
}

.program-week-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--theme-text-dark);
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--theme-action);
}

.week-locked-message {
    background: #fff3cd;
    border-left: 4px solid var(--theme-action);
    padding: 15px;
    border-radius: 4px;
    color: #856404;
    font-weight: 500;
}

/* Items Grid */
.week-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Item Cards */
.item-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.item-card:not(.locked):hover {
    border-color: var(--theme-elevated);
    box-shadow: 0 4px 16px rgba(19, 38, 58, 0.15);
    transform: translateY(-2px);
}

/* Card Header */
.card-header {
    background: linear-gradient(135deg, var(--theme-elevated) 0%, var(--theme-elevated-light) 100%);
    padding: 15px;
    display: flex;
    align-items: center;
}

.assessment-card .card-header {
    background: linear-gradient(135deg, var(--theme-elevated) 0%, var(--theme-elevated-light) 100%);
}

.day-card .card-header {
    background: linear-gradient(135deg, var(--theme-elevated) 0%, var(--theme-elevated-light) 100%);
}

.card-type {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 20px;
}

/* Day order indicator pushed to the right of the card header */
.day-number-badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.18);
    color: white;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Card Content */
.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--theme-text-dark);
    margin: 15px 15px 10px 15px;
    line-height: 1.4;
}

.card-title a {
    color: var(--theme-elevated);
    text-decoration: none;
    transition: color 0.3s ease;
}

.card-title a:hover {
    color: var(--theme-action);
    text-decoration: underline;
}

.item-card.locked .card-title {
    color: var(--theme-text-muted);
}

.card-description {
    color: var(--theme-text-muted);
    font-size: 14px;
    margin: 0 15px 15px 15px;
    flex-grow: 1;
    line-height: 1.5;
}

/* Card Footer */
.card-footer {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #e0e0e0;
}

.card-link {
    background: var(--theme-action);
    color: #fff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.card-link:hover {
    background: var(--theme-action-hover);
    transform: translateX(2px);
}

.assessment-card .card-link {
    background: var(--theme-action);
}

.assessment-card .card-link:hover {
    background: var(--theme-action-hover);
}

.day-card .card-link {
    background: var(--theme-elevated);
}

.day-card .card-link:hover {
    background: var(--theme-action);
}

/* Badge Styles */
.badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.completed-badge {
    background: #e8f5e9;
    color: #27ae60;
}

.locked-badge {
    background: #ffebee;
    color: #c62828;
}

/* Locked Day Card */
.item-card.locked {
    border-color: #ffcccc;
    background: #fffbfb;
    cursor: not-allowed;
}

.item-card.locked .card-title {
    color: var(--theme-text-muted);
}

.item-card.locked .card-description {
    color: #aaa;
    font-style: italic;
}

.item-card.locked .card-header {
    background: linear-gradient(135deg, #ccc 0%, #999 100%);
    opacity: 0.7;
}

/* Assessment Locked Page */
.assessment-locked-notice {
    background: #fff3cd;
    border-left: 4px solid var(--theme-action);
    padding: 20px;
    border-radius: 4px;
    text-align: center;
    margin: 20px 0;
}

.assessment-locked-notice p {
    color: #856404;
    font-weight: 600;
    font-size: 16px;
    margin: 0;
}

/* Assessment Page */
.assessment-page-wrapper {
    max-width: 600px;
    margin: 30px auto;
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.assessment-page-wrapper h1 {
    color: var(--theme-text-dark);
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--theme-action);
}

.assessment-description {
    color: var(--theme-text-muted);
    line-height: 1.6;
    margin-bottom: 30px;
    font-size: 15px;
}

.assessment-form-container {
    margin-top: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .program-week-item {
        padding: 20px;
    }

    .program-week-title {
        font-size: 20px;
    }

    .week-items-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .card-title {
        font-size: 16px;
    }

    .card-description {
        font-size: 13px;
    }

    .assessment-page-wrapper {
        padding: 20px;
        margin: 15px;
    }
}

@media (max-width: 480px) {
    .program-weeks {
        gap: 20px;
    }

    .program-week-item {
        padding: 15px;
    }

    .program-week-title {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .card-footer {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .card-link,
    .badge {
        width: 100%;
        text-align: center;
    }
}

/* Purchased programs / cards layout */
.purchased-programs-wrap{margin:2rem 0}
.purchased-programs-wrap h2{font-size:1.5rem;margin:0 0 1rem;color:var(--theme-text-dark,#0D0D0D)}
.programs-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem}
.program-card{background:var(--theme-surface,#ffffff);border:1px solid rgba(0,0,0,0.06);border-radius:8px;overflow:hidden;box-shadow:0 1px 4px rgba(0,0,0,0.04);transition:transform .18s ease,box-shadow .18s ease}
.program-card-link{color:inherit;text-decoration:none;display:block}
.program-card:hover{transform:translateY(-4px);box-shadow:0 6px 18px rgba(0,0,0,0.06)}
.program-card-media{height:140px;overflow:hidden;display:flex;align-items:center;justify-content:center;background:transparent}
.program-card-img{width:100%;height:100%;object-fit:cover}
.program-card-body{padding:1rem}
.program-card-title{margin:0 0 .5rem;font-size:1.05rem;color:var(--theme-text-dark,#0D0D0D)}
.program-card-excerpt{margin:0 0 .75rem;color:var(--theme-text-muted,#4D4D4D);font-size:.95rem}
.program-card-cta{display:inline-block;padding:.45rem .6rem;border-radius:4px;font-size:.85rem;font-weight:700}
.program-card-cta:hover{opacity:.95}
.no-programs{padding:1rem;border:1px dashed rgba(0,0,0,0.06);border-radius:8px;background:var(--theme-surface,#fbfbfd)}
.recommended-programs{margin-top:2rem}
@media (max-width:480px){.program-card-media{height:120px}}

/* Make assessment cards visually match workout/day cards */
.assessment-card{
    background:var(--theme-surface,#ffffff);
    border:1px solid rgba(0,0,0,0.06);
    border-radius:8px;
    overflow:hidden;
    box-shadow:0 1px 4px rgba(0,0,0,0.04);
    transition:transform .18s ease,box-shadow .18s ease;
}
.assessment-card:not(.locked):hover{transform:translateY(-4px);box-shadow:0 6px 18px rgba(0,0,0,0.06)}
.assessment-card .card-header{padding:12px;background:linear-gradient(135deg,var(--theme-elevated,#13263A),var(--theme-elevated-light,#1f3a52));color:#fff}
.assessment-card .card-title{margin:12px 12px .5rem 12px;color:var(--theme-text-dark,#0D0D0D);font-size:1.05rem}
.assessment-card .card-description{margin:0 12px 12px 12px;color:var(--theme-text-muted,#4D4D4D);font-size:.95rem}
.assessment-card .card-footer{padding:12px;border-top:1px solid rgba(0,0,0,0.06);display:flex;align-items:center;justify-content:space-between}

/* Ensure card-link when given button classes behaves like site buttons */
.card-link.button{display:inline-block;padding:.45rem .6rem}

/* ======================================
   ELEVATED CARD STYLES (DARK BACKGROUND)
   ====================================== */

/* Elevated item cards with dark background */
.item-card.elevated {
    background: var(--theme-elevated);
    border: 2px solid var(--theme-action);
    transition: all 0.3s ease;
}

.item-card.elevated:hover {
    border-color: var(--theme-action);
    box-shadow: 0 6px 20px rgba(234, 200, 31, 0.25);
    transform: translateY(-3px);
}

.item-card.elevated .card-header {
    background: linear-gradient(135deg, var(--theme-elevated) 0%, var(--theme-elevated-light) 100%);
}

.item-card.elevated .card-title {
    color: #F2F2F2;
}

.item-card.elevated .card-title a {
    color: #EAC81F;
}

.item-card.elevated .card-title a:hover {
    color: #ffdd55;
}

.item-card.elevated .card-description {
    color: #B2B2B2;
}

.item-card.elevated .card-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
}

.item-card.elevated .card-link {
    background: var(--theme-action);
    color: #13263A;
}

.item-card.elevated .card-link:hover {
    background: #ffdd55;
    color: #13263A;
}

/* Program card elevated styles */
.program-card.elevated {
    background: linear-gradient(135deg, var(--theme-elevated) 0%, var(--theme-elevated-light) 100%);
    border: 2px solid var(--theme-action);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.program-card.elevated:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(234, 200, 31, 0.2);
}

.program-card.elevated .program-card-title {
    color: #F2F2F2;
}

.program-card.elevated .program-card-description {
    color: #B2B2B2;
}

.program-card.elevated .program-card-cta {
    background: var(--theme-action);
    color: var(--theme-elevated);
    font-weight: 700;
}

.program-card.elevated .program-card-cta:hover {
    background: #ffdd55;
}
