:root {
    --primary: #ff6b35;
    --secondary: #f7931e;
    --dark: #1a1a2e;
    --darker: #16213e;
    --light: #e94560;
    --white: #ffffff;
    --gray: #b8b8b8;
    --success: #00d9ff;
    --gradient: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
}

/* ==========================================
   BUG FIX: Prevent Extra Scrolling
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Hind Siliguri', sans-serif;
}

html {
    scroll-behavior: smooth;
    /* BUG FIX: Prevent horizontal scroll from 100vw */
    overflow-x: hidden;
    /* Ensure proper height calculation */
    height: 100%;
}

body {
    background: var(--dark);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: auto; /* Ensure vertical scroll works */
    /* Ensure body takes full height */
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* BUG FIX: Prevent margin collapsing at bottom */
body::after {
    content: "";
    display: table;
    height: 0;
}

/* Main content wrapper to push footer down */
main {
    flex: 1 0 auto;
    width: 100%;
    /* Ensure main can scroll if needed */
    min-height: 0;
}

/* ==========================================
   Navigation
   ========================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-bottom: 2px solid var(--primary);
    /* BUG FIX: Prevent navbar from causing overflow */
    max-width: 100vw;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-brand i {
    font-size: 2rem;
}

.nav-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--white);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s;
    font-weight: 600;
}

.nav-menu a:hover {
    color: var(--primary);
}

/* ==========================================
   Hero Section
   ========================================== */
.hero {
    margin-top: 70px;
    padding: 3rem 1rem;
    text-align: center;
    background: var(--gradient);
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* BUG FIX: Prevent overflow on mobile */
    width: 100%;
    max-width: 100%;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    /* BUG FIX: Prevent text overflow */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.btn-primary {
    background: var(--dark);
    color: var(--white);
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
    font-weight: 600;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
    width: 100%;
    max-width: 800px;
    /* BUG FIX: Prevent grid overflow */
    padding: 0 1rem;
}

.stat-card {
    background: rgba(255,255,255,0.2);
    padding: 1.5rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.stat-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-card h3 {
    font-size: 2rem;
    color: var(--dark);
}

/* ==========================================
   Sections
   ========================================== */
.section {
    padding: 4rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    /* BUG FIX: Ensure sections don't overflow */
    width: 100%;
    overflow-x: hidden;
}

.bg-dark {
    background: var(--darker);
    max-width: 100%;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    /* BUG FIX: Prevent title overflow */
    flex-wrap: wrap;
    padding: 0 1rem;
}

/* ==========================================
   Filters
   ========================================== */
.filter-container {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    -webkit-overflow-scrolling: touch;
    /* BUG FIX: Hide scrollbar but keep functionality */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-container::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
    font-weight: 600;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary);
    color: var(--white);
}

/* ==========================================
   Courses Grid
   ========================================== */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    /* BUG FIX: Prevent grid overflow */
    width: 100%;
}

.course-card {
    background: var(--darker);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(255,255,255,0.1);
    /* BUG FIX: Ensure cards don't break layout */
    max-width: 100%;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(255,107,53,0.2);
}

.course-thumbnail {
    position: relative;
    height: 180px;
    background: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.course-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-icon {
    position: absolute;
    font-size: 3rem;
    color: var(--primary);
    background: rgba(0,0,0,0.7);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s;
}

.play-icon:hover {
    transform: scale(1.1);
}

.course-info {
    padding: 1.5rem;
}

.course-category {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
}

.course-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    /* BUG FIX: Prevent long titles from breaking layout */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.course-meta {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    color: var(--gray);
    font-size: 0.9rem;
}

.course-meta i {
    color: var(--primary);
}

.course-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.btn-watch {
    background: var(--primary);
    color: var(--white);
}

.btn-pdf {
    background: transparent;
    border: 2px solid var(--light);
    color: var(--light);
}

.btn-delete {
    background: transparent;
    border: 2px solid #ff4757;
    color: #ff4757;
    width: 40px;
}

.btn-small:hover {
    transform: scale(1.05);
}

/* ==========================================
   Form Styles
   ========================================== */
.course-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--dark);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    /* BUG FIX: Prevent form overflow on mobile */
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: var(--darker);
    color: var(--white);
    font-size: 1rem;
    transition: border-color 0.3s;
    /* BUG FIX: Prevent input overflow */
    max-width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group small {
    color: var(--gray);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

.pdf-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0,217,255,0.1);
    border-radius: 8px;
    color: var(--success);
}

.pdf-preview.hidden {
    display: none;
}

.btn-remove {
    background: none;
    border: none;
    color: #ff4757;
    cursor: pointer;
    margin-left: auto;
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background: var(--gradient);
    border: none;
    border-radius: 10px;
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-submit:hover {
    transform: translateY(-2px);
}

/* ==========================================
   Progress Section
   ========================================== */
.progress-container {
    display: grid;
    gap: 2rem;
    /* BUG FIX: Prevent container overflow */
    width: 100%;
}

.progress-card {
    background: var(--darker);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
}

.circular-progress {
    width: 150px;
    height: 150px;
    margin: 1rem auto;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 0deg, rgba(255,255,255,0.1) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.circular-progress::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background: var(--darker);
    border-radius: 50%;
}

.progress-value {
    position: relative;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-box {
    background: var(--darker);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
}

.stat-box i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-box h4 {
    font-size: 1.8rem;
    color: var(--success);
}

.weight-tracker {
    background: var(--darker);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    /* BUG FIX: Prevent excessive expansion */
    max-height: 500px;
    display: flex;
    flex-direction: column;
}

.weight-input-group {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    /* BUG FIX: Prevent overflow on mobile */
    flex-wrap: wrap;
}

.weight-input-group input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: var(--dark);
    color: var(--white);
    min-width: 200px;
}

.weight-history {
    margin: 1rem 0;
    max-height: 150px;
    overflow-y: auto;
    /* BUG FIX: Prevent expansion */
    flex-shrink: 0;
}

.weight-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(255,255,255,0.05);
    margin-bottom: 0.5rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

/* ==========================================
   Modal
   ========================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    overflow-y: auto;
    /* BUG FIX: Ensure modal doesn't cause body scroll when hidden */
    pointer-events: none;
}

.modal[style*="display: block"] {
    pointer-events: auto;
}

.modal-content {
    background: var(--darker);
    margin: 5% auto;
    padding: 2rem;
    width: 90%;
    max-width: 800px;
    border-radius: 20px;
    position: relative;
    animation: slideIn 0.3s;
    /* BUG FIX: Prevent modal content overflow */
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--gray);
    z-index: 10;
}

.close-btn:hover {
    color: var(--primary);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 15px;
    margin: 1rem 0;
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================
   Toast
   ========================================== */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: 50px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 3000;
    font-weight: 600;
    /* BUG FIX: Ensure toast doesn't cause scroll */
    pointer-events: none;
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ==========================================
   Footer - NEW MODERN DESIGN
   ========================================== */
.footer {
    background: var(--darker);
    border-top: 3px solid var(--primary);
    padding: 3rem 1rem 1rem;
    margin-top: auto;
    width: 100%;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-brand h3 {
    color: var(--primary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-brand p {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s;
    border: 1px solid rgba(255,255,255,0.2);
}

.footer-social a:hover {
    background: var(--primary);
    transform: translateY(-3px);
    border-color: var(--primary);
}

.footer-links h4,
.footer-contact h4,
.footer-newsletter h4 {
    color: var(--white);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: var(--gray);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.footer-links a::before {
    content: '›';
    color: var(--primary);
    font-weight: bold;
}

.footer-contact p {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-contact i {
    color: var(--primary);
    width: 20px;
}

.footer-newsletter p {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 25px;
    background: rgba(255,255,255,0.1);
    color: var(--white);
    font-size: 0.9rem;
}

.newsletter-form input::placeholder {
    color: var(--gray);
}

.newsletter-form button {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    border: none;
    border-radius: 25px;
    color: var(--white);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.newsletter-form button:hover {
    background: var(--secondary);
    transform: scale(1.05);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--gray);
    font-size: 0.85rem;
}

.footer-bottom a {
    color: var(--gray);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-bottom a:hover {
    color: var(--primary);
}

.footer-legal {
    display: flex;
    gap: 1.5rem;
}

/* ==========================================
   Mobile Responsive
   ========================================== */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--darker);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 2rem 0;
        gap: 1rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .courses-grid {
        grid-template-columns: 1fr;
    }

    .filter-container {
        gap: 0.3rem;
    }

    .filter-btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }

    .course-form {
        padding: 1.5rem;
    }

    .weight-input-group {
        flex-direction: column;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-links ul {
        align-items: center;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .modal-content {
        margin: 10% auto;
        padding: 1.5rem;
    }
}

/* ==========================================
   Animations
   ========================================== */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}


/* BUG FIX: Canvas sizing constraints */
#weightChart {
    max-height: 250px !important;
    width: 100% !important;
    /* Prevent canvas from expanding */
    aspect-ratio: 2 / 1;
}

/* Ensure chart container doesn't grow */
.weight-tracker canvas {
    max-height: 250px;
    width: 100%;
    object-fit: contain;
}

/* ==========================================
   Scrollbar
   ========================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* ==========================================
   Empty State
   ========================================== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

/* ==========================================
   Optional Enhancements
   ========================================== */

/* Video Preview Box */
#videoPreview {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(46, 213, 115, 0.1);
    border: 2px solid #2ed573;
    border-radius: 10px;
    text-align: center;
    animation: slideDown 0.3s ease;
}

#videoPreview img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 0.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Error Message Animation */
#videoError {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Server Notice Enhancement */
.server-notice {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    border-radius: 10px;
    padding: 1rem;
    margin-top: 2rem;
}

.server-notice h4 {
    color: #ffc107;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.server-notice code {
    background: rgba(0,0,0,0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #00d9ff;
}


/* ==========================================
   CRITICAL BUG FIXES: Prevent Blank Space
   ========================================== */

/* ==========================================
   SCROLL FIX: Allow normal scrolling
   ========================================== */

/* Allow normal scrolling but prevent horizontal */
html, body {
    overflow-x: hidden;
    /* Keep vertical scroll working */
    overflow-y: auto;
}

/* Main content takes available space */
main {
    flex: 1 0 auto;
}

/* Weight tracker - constrained but scrollable inside if needed */
.weight-tracker {
    max-height: 500px;
    overflow-y: auto;  /* Allow internal scroll if needed */
}

/* Chart canvas - fixed height */
.weight-tracker canvas {
    height: 220px !important;
    max-height: 220px !important;
    width: 100% !important;
}

/* Footer normal positioning */
.footer {
    margin-top: auto;
}

/* ==========================================
   HEADER HIDE ON SCROLL
   ========================================== */

.navbar {
    /* Add transition for smooth hide/show */
    transition: transform 0.3s ease-in-out, top 0.3s ease-in-out;
    will-change: transform;
}

.navbar.hidden {
    transform: translateY(-100%);
}

/* Optional: Add shadow when scrolled */
.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    background: rgba(26, 26, 46, 0.98);
}


/* ==========================================
   PASSWORD MODAL & ADMIN PANEL
   ========================================== */

/* Password Modal Specific Styles */
#passwordModal .modal-content {
    background: linear-gradient(135deg, var(--darker) 0%, #1a1a2e 100%);
    border: 2px solid var(--primary);
}

#passwordModal h2 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

#passwordModal .form-group {
    margin: 1.5rem 0;
}

#passwordModal input {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    color: var(--white);
    padding: 1rem;
    border-radius: 10px;
    width: 100%;
    font-size: 1.1rem;
    text-align: center;
    transition: all 0.3s;
}

#passwordModal input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255,255,255,0.15);
}

#passwordModal input::placeholder {
    color: var(--gray);
}

#passwordError {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Admin Panel Styles */
.admin-header {
    background: rgba(255,107,53,0.1);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid rgba(255,107,53,0.3);
    margin-bottom: 2rem;
}

.admin-header .section-title {
    color: var(--primary);
}

/* Add Course Section Animation */
#add-course {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logout Button */
.admin-header .btn-primary {
    background: #ff4757;
    transition: all 0.3s;
}

.admin-header .btn-primary:hover {
    background: #ff3344;
    transform: scale(1.05);
}


/* ==========================================
   ANDROID SPECIFIC STYLES (Mobile Only)
   PC/Desktop version remains unchanged
   ========================================== */

/* Only apply to touch devices (Android/iOS) */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for Android */
    .btn-primary,
    .btn-small,
    .filter-btn,
    .nav-menu a {
        min-height: 48px; /* Android Material Design standard */
        min-width: 48px;
    }

    /* Increase spacing for touch */
    .course-actions {
        gap: 0.75rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevent zoom on Android */
        padding: 1rem;
    }

    /* Better touch feedback */
    .course-card:active,
    .btn-primary:active,
    .btn-small:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    /* Remove hover effects on touch devices */
    .course-card:hover,
    .btn-primary:hover,
    .btn-small:hover {
        transform: none;
        box-shadow: none;
    }

    /* Faster animations for mobile */
    .navbar,
    .modal-content,
    .course-card,
    .btn-primary,
    .btn-small {
        transition-duration: 0.2s;
    }

    /* Bottom safe area for Android navigation bar */
    .footer {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    /* Prevent text selection on buttons (Android) */
    button,
    .btn-primary,
    .btn-small,
    .play-icon,
    .nav-toggle {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }

    /* Improve scrolling on Android */
    .weight-history,
    .filter-container {
        -webkit-overflow-scrolling: touch;
    }

    /* Disable callout on long press */
    img {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
    }
}

/* Specific Android optimizations */
@supports (-webkit-touch-callout: none) {
    /* iOS specific - keep as is */
}

@supports (not (-webkit-touch-callout: none)) and (hover: none) {
    /* Android specific enhancements */

    /* Material Design ripple effect simulation */
    .btn-primary::after,
    .btn-small::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        background: rgba(255,255,255,0.3);
        border-radius: 50%;
        transform: translate(-50%, -50%);
        transition: width 0.3s, height 0.3s;
    }

    .btn-primary:active::after,
    .btn-small:active::after {
        width: 200%;
        height: 200%;
    }

    /* Status bar color for Android PWA */
    .navbar {
        padding-top: calc(1rem + env(safe-area-inset-top));
    }
}

/* PWA standalone mode optimizations */
@media (display-mode: standalone) {
    .navbar {
        padding-top: calc(1rem + env(safe-area-inset-top));
    }

    .hero {
        margin-top: calc(70px + env(safe-area-inset-top));
    }
}


/* ==========================================
   CONNECTION STATUS INDICATOR
   ========================================== */

.connection-status {
    margin-left: 10px;
    font-size: 0.7rem;
    color: #2ed573;
    animation: pulse 2s infinite;
    display: inline-flex;
    align-items: center;
}

.connection-status.offline {
    color: #ff4757;
    animation: none;
}

.connection-status.syncing {
    color: #ffa502;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Real-time update animation for courses */
.course-card {
    transition: all 0.3s ease;
}

.course-card.new-course {
    animation: highlightNew 2s ease;
}

@keyframes highlightNew {
    0% { 
        border-color: var(--primary);
        box-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
    }
    100% { 
        border-color: rgba(255,255,255,0.1);
        box-shadow: none;
    }
}