@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-dark: #2F343A;
    --bg-medium: #3B4047;
    --bg-light: #4A4F56;
    --text-primary: #E0E0E0;
    --text-secondary: #A0A0A0;
    --border-color: #555A60;
    --accent-blue: #0A84FF;
    --status-not-started: #7A7A7A;
    --tag-strength: #E44D26;
    --tag-endurance: #F7BF38;
    --tag-hypertrophy: #9B59B6;
    --tag-full-body: #2ECC71;
    --tag-upper-lower: #3498DB;
    --tag-push-pull-legs: #E67E22;
    --accent-green: #27ae60;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.container {
    width: 95%;
    max-width: 1400px;
    background-color: var(--bg-medium);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin: 20px 0;
    overflow: hidden;
}

/* Navbar (Top Header) */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
}

.nav-left i.fa-bars {
    margin-right: 15px;
    font-size: 1.2em;
    cursor: pointer;
    color: var(--text-secondary);
}

.program-title {
    font-weight: 600;
    font-size: 1.1em;
}

.nav-right i {
    margin-left: 15px;
    color: var(--text-secondary);
    cursor: pointer;
}

.share-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.share-btn i {
    margin-right: 5px;
    margin-left: 0;
}

/* Main Navigation (Below Header) */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
}

.main-nav ul li {
    margin-right: 25px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px 0;
    position: relative;
    font-weight: 500;
}

.main-nav ul li.active {
    color: var(--text-primary);
}

.main-nav ul li.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-blue);
}

.nav-actions {
    display: flex;
    align-items: center;
}

.search-input {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 5px;
    color: var(--text-primary);
    margin-right: 10px;
    font-size: 0.9em;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.new-btn {
    background-color: var(--accent-blue);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
}

.new-btn i {
    margin-right: 5px;
}

/* Main Content Sections */
.content {
    padding: 15px 20px;
}

.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

/* --- Image Slider --- */
.image-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

.image-slider {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.image-slider img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    flex-shrink: 0;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 15px 10px;
    cursor: pointer;
    font-size: 1.5em;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.slider-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.slider-dots-container {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: white;
}

/* --- About & Testimonials Sections --- */
.about-section, .testimonials-section, .plans-section {
    background-color: var(--bg-light);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.about-section h2, .testimonials-section h2, .plans-section h2 {
    color: var(--text-primary);
    font-size: 1.8em;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--accent-blue);
    padding-bottom: 5px;
    display: inline-block;
}

.about-section p {
    line-height: 1.6;
    color: var(--text-secondary);
}

.testimonial-card {
    background-color: var(--bg-medium);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 2px solid var(--accent-blue);
}

.user-info h3 {
    margin: 0;
    font-size: 1.2em;
    color: var(--text-primary);
}

.user-info p {
    margin: 0;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.testimonial-text {
    font-style: italic;
    color: var(--text-primary);
    line-height: 1.5;
}

/* --- New Plans Section --- */
.plans-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.plan-card {
    background-color: var(--bg-medium);
    border-radius: 8px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid transparent;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.plan-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-blue);
}

.featured-plan {
    border-color: var(--accent-blue);
    background-color: rgba(10, 132, 255, 0.1);
}

.plan-card h3 {
    margin-top: 0;
    font-size: 1.5em;
    color: var(--text-primary);
}

.plan-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

.plan-time {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 10px;
}

.plan-price {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--accent-blue);
    margin-top: 10px;
    margin-bottom: 20px;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    text-align: left;
    width: 100%;
}

.plan-features li {
    margin-bottom: 10px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.plan-features li i {
    color: var(--accent-green);
    margin-right: 10px;
}

.buy-btn {
    background-color: var(--accent-blue);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.buy-btn:hover {
    background-color: #0866c2;
}

/* --- Schedule Table Styles (Desktop) --- */
.table-header, .table-row {
    display: grid;
    grid-template-columns: 0.8fr 1.5fr 1fr 1.2fr 3fr 1fr 0.8fr 0.3fr;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    font-size: 0.9em;
}

.table-header {
    font-weight: 600;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    background-color: var(--bg-medium);
    z-index: 10;
}

.column-header i.fa-info-circle {
    margin-left: 5px;
    color: var(--text-secondary);
    cursor: help;
}

.table-row {
    color: var(--text-primary);
    transition: background-color 0.2s ease-in-out;
}

.table-row:hover {
    background-color: rgba(var(--bg-light), 0.5);
}

.cell {
    padding: 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.week-number-cell {
    display: flex;
    align-items: center;
}

.week-toggle-icon {
    margin-right: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.week-toggle-icon.expanded {
    transform: rotate(90deg);
}

.tags-container {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.tag {
    background-color: var(--bg-light);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
    white-space: nowrap;
}

.tag.strength { background-color: var(--tag-strength); color: white; }
.tag.endurance { background-color: var(--tag-endurance); color: #333; }
.tag.hypertrophy { background-color: var(--tag-hypertrophy); color: white; }
.tag.full-body { background-color: var(--tag-full-body); color: white; }
.tag.upper-lower { background-color: var(--tag-upper-lower); color: white; }
.tag.push-pull-legs { background-color: var(--tag-push-pull-legs); color: white; }

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 500;
    color: var(--text-primary);
}

.status-pill::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-pill.not-started {
    background-color: rgba(122, 122, 122, 0.2);
    color: #7A7A7A;
}

.status-pill.not-started::before {
    background-color: #7A7A7A;
}

.in-progress {
    background-color: rgba(10, 132, 255, 0.2);
    color: #0A84FF;
}

.in-progress::before {
    background-color: #0A84FF;
}

.notes-cell {
    cursor: pointer;
}

.notes-cell:hover {
    text-decoration: underline;
}

.actions-cell {
    text-align: right;
}

.actions-cell i {
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.table-row:hover .actions-cell i {
    opacity: 1;
}

/* --- Modal Styles --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 20; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8); 
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.modal-content {
    background-color: var(--bg-medium);
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    position: relative;
    color: var(--text-primary);
}

.modal-content h3 {
    margin-top: 0;
    border-bottom: 2px solid var(--accent-blue);
    padding-bottom: 5px;
}

.modal-content p {
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap; /* Preserve formatting */
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 25px;
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--text-primary);
}

/* Purchase Modal Specific Styles */
.purchase-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.purchase-qr {
    text-align: center;
}

.qr-code {
    width: 200px;
    height: 200px;
    border-radius: 5px;
    border: 2px solid var(--border-color);
}

.upi-id {
    margin-top: 10px;
    font-size: 1.1em;
    font-weight: 500;
}

.purchase-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-instructions {
    color: var(--text-secondary);
    font-size: 0.9em;
    text-align: center;
    margin-bottom: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.form-group input {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 1em;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.submit-btn {
    background-color: var(--accent-blue);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    background-color: #0866c2;
}

/* --- Mobile Responsiveness (Media Queries) --- */
@media (max-width: 768px) {
    .container {
        width: 100%;
        margin: 0;
        border-radius: 0;
    }

    .navbar {
        padding: 10px 15px;
    }

    .program-title {
        font-size: 1em;
    }

    .share-btn {
        display: none; /* Hide share button to save space */
    }

    .nav-left i.fa-bars {
        margin-right: 10px;
    }

    .main-nav {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 15px;
    }

    .main-nav ul {
        flex-direction: column;
        width: 100%;
        margin-bottom: 10px;
    }

    .main-nav ul li {
        margin-right: 0;
        padding: 10px 0;
    }

    .main-nav ul li.active::after {
        bottom: 2px;
    }

    .nav-actions {
        width: 100%;
        justify-content: space-between;
    }

    .search-input {
        flex-grow: 1;
    }

    .content {
        padding: 15px;
    }

    .image-slider img {
        height: 250px; /* Make slider images shorter */
    }

    .slider-btn {
        padding: 10px 5px;
        font-size: 1.2em;
    }

    .about-section, .testimonials-section, .plans-section {
        padding: 20px;
    }

    .about-section h2, .testimonials-section h2, .plans-section h2 {
        font-size: 1.5em;
    }
    
    .plans-container {
        grid-template-columns: 1fr; /* Stack plans on mobile */
    }

    /* Adjusting schedule table for smaller screens */
    .table-header {
        display: none; /* Hide the full header on mobile */
    }
    
    .table-body {
        /* Remove desktop-specific grid for a stacked layout */
        display: block;
    }

    .table-row {
        /* Remove grid layout for mobile */
        display: block;
        padding: 15px;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 15px;
        background-color: var(--bg-light);
        border-radius: 8px;
    }
    
    .table-row:last-child {
        border-bottom: none;
    }

    .cell {
        padding: 5px 0;
        white-space: normal;
        text-overflow: unset;
        width: 100%;
    }
    
    /* Display a label for each cell on mobile */
    .cell::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: var(--text-secondary);
        display: inline-block;
        margin-right: 5px;
    }

    .week-number-cell, .phase-col, .split-type-col, .focus-col, .notes-col, .status-col, .training-days-col, .actions-col {
        grid-row: auto;
        grid-column: auto;
    }
    
    .week-number-cell::before { content: "Week Number"; }
    .phase-col::before { content: "Phase"; }
    .split-type-col::before { content: "Split Type"; }
    .focus-col::before { content: "Focus"; }
    .notes-col::before { content: "Notes"; }
    .status-col::before { content: "Status"; }
    .training-days-col::before { content: "# Training Days"; }
    
    .notes-col, .status-col, .training-days-col, .actions-col {
        text-align: left; /* Align text to the left on mobile */
    }

    .actions-cell {
        display: none; /* Hide actions on mobile for simplicity */
    }

    .table-row:hover .actions-cell i {
        opacity: 0;
    }

    /* Modal responsiveness */
    .modal-content {
        padding: 20px;
    }

    .qr-code {
        width: 150px;
        height: 150px;
    }
}

/* Media query for smaller tablets and larger phones */
@media (min-width: 481px) and (max-width: 768px) {
    .plans-container {
        grid-template-columns: repeat(2, 1fr);
    }
}