/* ============================================================
   WORKOUT SUPERVISOR - DARK MODE STYLE SHEET (UPDATED)
   ============================================================ */

/* --- Global Variables & Resets --- */
:root {
    --nav-bar-color: #1e1e1e; /* Shared color for Top and Bottom bars */
    --nav-border: 1px solid #333;
}

* { box-sizing: border-box; }

body { 
    font-family: 'Inter', Arial, sans-serif; 
    background-color: #121212; /* Deep Black Page Background */
    color: #e0e0e0;            /* Light Grey Text */
    margin: 0; 
    /* CHANGED: Added padding-top for fixed header */
    padding-top: 80px;         
    padding-bottom: 80px; 
}

/* --- Main Layout Wrapper (TRANSPARENT) --- */
.container { 
    width: 100%; 
    max-width: 960px; 
    margin: 20px auto; 
    padding: 20px; 
    background-color: transparent; 
    box-shadow: none; 
    border: none;
}

/* --- Content Containers (DARK CARDS) --- */
.grid-item, 
.login-panel,
.accountability-card,
.app-download-card { 
    background: linear-gradient(145deg, #2b3035, #121212); 
    padding: 25px; 
    border-radius: 15px; 
    margin-bottom: 25px; 
    border: 1px solid #444;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    color: white;
}

/* --- INDEX PAGE LAYOUT --- */
.index-container {
    width: 100%;
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 40px;
    align-items: center;
}
.info-panel { grid-column: 1; grid-row: 1; text-align: left; padding-right: 20px; }
.login-panel { grid-column: 2; grid-row: 1; padding: 40px; }
.app-download-card { grid-column: 1 / -1; grid-row: 2; text-align: center; margin-top: 20px; }

/* --- Typography --- */
h1, h2, h3, h4, .section-title { color: #ffffff !important; font-weight: 900; margin: 0 0 15px; }
.section-title { border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; margin-bottom: 20px; text-align: left; font-size: 1.2em; }
.subheadline, .tagline { color: #b0b0b0; line-height: 1.5; }
label { color: #cfcfcf !important; }

/* --- Buttons --- */
.btn, .bell-button, .btn-login, .btn-register, .install-btn { 
    display: inline-block; padding: 12px 20px; font-size: 1rem; font-weight: bold;
    background-color: #343a40 !important; color: white !important; 
    border: 1px solid #555; border-radius: 6px; text-align: center; cursor: pointer; text-decoration: none; transition: all 0.2s ease; 
}
.btn:hover, .btn-login:hover { background-color: #495057 !important; border-color: #fff; }
.btn-login { width: 100%; margin-top: 10px; }
.bell-button { display: block; width: 100%; padding: 15px 10px; font-size: 1.25rem; font-weight: 600; background-color: white !important; color: #212529 !important; border: none; margin-top: 20px; }
.install-btn { background-color: white !important; color: #212529 !important; border-radius: 50px; border: none; }
.submit-container .btn { width: 100%; padding: 12px; font-size: 1.1em; }
.btn-sm { padding: 8px 14px; font-size: 0.9em; width: auto; margin-left: 10px; }
.btn-accept { background-color: #198754 !important; border-color: #198754; }
.btn-decline { background-color: #dc3545 !important; border-color: #dc3545; }

/* --- Forms & Inputs --- */
input, select { 
    width: 100%; padding: 12px; border-radius: 6px; font-size: 1rem; box-sizing:border-box;
    background-color: #2c2c2c !important; color: #fff !important; border: 1px solid #555 !important;
}
input:focus, select:focus { outline: none; border-color: #fd7e14 !important; background-color: #3a3a3a !important; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; margin-top: 20px; }
.form-group { margin-bottom: 18px; position: relative; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.9em; }

/* --- Tables --- */
.table-wrapper { overflow-x: auto; margin-top: 20px; }
table { width: 100%; border-collapse: collapse; }
table, th, td { border: 1px solid #444; }
th, td { padding: 12px; text-align: center; font-size: 0.9em; vertical-align: middle; color: #ddd; }
th { background-color: rgba(255,255,255,0.05); font-weight: 600; color: #fff;}
tbody tr:nth-child(odd) { background-color: rgba(255,255,255,0.02); }

/* --- Progress Cards --- */
.progress-cards-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; margin-top: 20px; }
.progress-card { 
    background: linear-gradient(to bottom, #ffc371, #ff5f6d); color: white; padding: 20px 10px; 
    border-radius: 20px; text-align: center; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); display: flex; flex-direction: column; align-items: center; 
}
.card-silhouette { width: 70px !important; height: 70px !important; margin-bottom: 10px; filter: brightness(0) opacity(0.6); mix-blend-mode: multiply; }
.card-label { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; margin-bottom: 0; color: rgba(255, 255, 255, 0.9); }
.card-percent { font-size: 2rem; font-weight: 800; margin: 5px 0 10px 0; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.progress-bar-bg { width: 100%; height: 6px; background-color: rgba(0, 0, 0, 0.15); border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.progress-bar-fill { height: 100%; background-color: white; border-radius: 10px; }
.card-details { font-size: 0.8rem; opacity: 0.9; font-weight: 500; }

/* --- Swinging Bell Logic --- */
.accountability-main-icon { 
    font-size: 3.5rem; margin-bottom: 15px; display: inline-block; color: #fd7e14; 
    animation: swing 2s ease-in-out infinite; transform-origin: top center;
}
.accountability-card { padding: 30px; text-align: center; }
.log-workout-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; align-items: end; max-width: 800px; margin: 0 auto; }

/* --- Misc --- */
.success-message { color: #0f5132; background-color: #d1e7dd; border: 1px solid #badbcc; padding: 1rem; border-radius: 6px; margin-bottom: 20px; text-align: center; }
.toggle-password { position: absolute; top: 38px; right: 10px; cursor: pointer; color: #aaa; font-size: 0.8em; }
.chart-container { position: relative; height: 500px; width: 100%; margin-top: 20px;}
.extra-links { text-align: center; margin-top: 20px; font-size: 0.9em; }
.extra-links a { color: #fd7e14; text-decoration: none; }
.register-block { text-align: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid #444; }
.checkbox-group { display: flex; align-items: center; justify-content: flex-start; width: 100%; margin-bottom: 20px; }
.checkbox-group input { width: auto; margin-right: 10px; transform: scale(1.2); }
.checkbox-group label { margin-bottom: 0; font-weight: normal; }

/* --- Index Icons --- */
.exercises { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; list-style: none; padding: 0; margin: 0 0 25px; }
.exercises li { background-color: #2c2c2c; border: 1px solid #444; padding: 15px; border-radius: 15px; font-weight: 700; color: #fff; display: flex; flex-direction: column; align-items: center; }
.exercise-icon { width: 80px; height: 80px; object-fit: contain; margin-bottom: 10px; filter: invert(1); }

/* --- Bottom Nav (UPDATED) --- */
.bottom-nav { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    /* CHANGED: Use shared variable */
    background-color: var(--nav-bar-color) !important; 
    border-top: var(--nav-border) !important;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5); 
    display: flex; 
    justify-content: space-around; 
    padding: 10px 0; 
    z-index: 1000; 
}
.nav-item { display: flex; flex-direction: column; align-items: center; color: #888; cursor: pointer; flex-grow: 1; padding: 5px; position: relative; }
.nav-item:hover { color: #ccc; }
.nav-item.active { color: #fd7e14; font-weight: 600; }
.nav-icon { font-size: 1.5rem; margin-bottom: 2px; }
.nav-label { font-size: 0.8rem; }
.nav-badge-dot { position: absolute; top: 5px; right: 25%; width: 10px; height: 10px; background-color: #fd7e14; border-radius: 50%; border: 2px solid #1e1e1e; }

/* --- Mobile Queries --- */
@media (max-width: 800px) {
    .index-container { grid-template-columns: 1fr; grid-template-rows: auto auto auto; gap: 30px; }
    .info-panel { text-align: center; grid-column: 1; grid-row: 1; }
    .login-panel { grid-column: 1; grid-row: 2; }
    .app-download-card { grid-column: 1; grid-row: 3; }
    .exercises { justify-content: center; }
}
@media (max-width: 600px) {
    .log-workout-grid { grid-template-columns: 1fr 1fr; }
    .progress-cards-container { grid-template-columns: 1fr 1fr; }
}

/* --- ANIMATION KEYFRAMES --- */
@keyframes swing { 
    0% { transform: rotate(0deg); } 10% { transform: rotate(15deg); } 30% { transform: rotate(-10deg); } 
    50% { transform: rotate(5deg); } 70% { transform: rotate(-5deg); } 100% { transform: rotate(0deg); } 
}

/* --- MOBILE TABLE CARDS --- */
@media screen and (max-width: 600px) {
    .table-wrapper table thead { display: none; }
    .table-wrapper table tr { display: block; margin-bottom: 15px; border: 1px solid #444; border-radius: 8px; background-color: #2c2c2c; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
    .table-wrapper table td { display: flex; justify-content: space-between; align-items: center; text-align: right; padding: 10px 15px; border-bottom: 1px solid #333; font-size: 0.95em; word-break: break-word; }
    .table-wrapper table td:last-child { border-bottom: none; }
    .table-wrapper table td::before { content: attr(data-label); float: left; font-weight: bold; text-transform: uppercase; color: #aaa; font-size: 0.85em; margin-right: 15px; }
    .table-wrapper table tr[style*="background"] { background-color: #3d3318 !important; border: 1px solid #fd7e14; }
}

/* --- Challenge Hub Styles --- */
.challenge-hub-container { width: 100%; display: flex; justify-content: center; padding: 0; font-family: sans-serif; }
.hub-card { background-color: #1e1e1e; width: 100%; max-width: 500px; border: 1px solid #444; border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.hub-charity-title { color: #ffffff; font-size: 1.4rem; font-weight: 700; text-align: center; margin: 0; text-transform: uppercase; }
.hub-timer { color: #FF9800; font-size: 2.2rem; font-weight: 800; text-align: center; margin: 5px 0 15px 0; letter-spacing: 1px; line-height: 1.2; }
.hub-description { color: #e0e0e0; text-align: center; font-size: 0.95rem; font-style: italic; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #444; }
.hub-details-grid { background: rgba(255, 255, 255, 0.05); border-radius: 8px; padding: 15px; display: flex; flex-direction: column; gap: 10px; }
.detail-row { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #444; padding-bottom: 8px; }
.detail-row:last-child { border-bottom: none; padding-bottom: 0; }
.detail-label { color: #cccccc; font-size: 0.9rem; }
.detail-value { color: #ffffff; font-weight: 600; text-align: right; font-size: 0.95rem; }
.hub-financials { border-top: 2px solid #444; padding-top: 15px; display: flex; flex-direction: column; gap: 10px; }
.financial-row { display: flex; justify-content: space-between; color: #fff; font-size: 1rem; }
.total-owed .financial-value { font-weight: bold; }
.hub-actions { display: flex; justify-content: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.btn-hub { padding: 10px 20px; font-size: 0.9rem; border-radius: 6px; border: none; cursor: pointer; font-weight: 600; color: white; width: auto; min-width: 120px; }
.btn-leave { background-color: #444; }
.btn-pending { background-color: #666; }

/* --- Friend View Styles --- */
.friends-wrapper { display: flex; flex-direction: column; gap: 20px; max-width: 800px; margin: 0 auto; }
.friend-card { background-color: #1e1e1e; border: 1px solid #444; border-radius: 12px; padding: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.friend-section-title { margin-top: 0; margin-bottom: 15px; border-bottom: 1px solid #444; padding-bottom: 10px; font-size: 1.1rem; color: #fff; text-transform: uppercase; }
.friend-item-row { display: flex; justify-content: space-between; align-items: center; background-color: #2c2c2c; border: 1px solid #333; padding: 15px; border-radius: 8px; margin-bottom: 10px; gap: 15px; }
.friend-text { color: #e0e0e0; font-size: 1rem; flex: 1 1 200px; }
.friend-actions { display: flex; align-items: center; gap: 10px; }
ul.friend-list-container { list-style-type: none !important; padding: 0 !important; margin: 0; }
.friend-list-item { display: flex; justify-content: space-between; align-items: center; padding: 15px 10px; border-bottom: 1px solid #333; }
.friend-list-item:last-child { border-bottom: none; }
.friend-avatar-area { display: flex; align-items: center; gap: 15px; color: #fff; font-weight: 600; }
@media (max-width: 600px) {
    .friend-item-row { flex-direction: column; align-items: stretch; text-align: center; }
    .friend-text { flex: 0 0 auto; margin-bottom: 10px; }
    .friend-actions { flex-direction: column; width: 100%; }
    .friend-actions form { width: 100%; }
    .friend-actions button { width: 100%; margin-top: 5px; }
}

/* --- UPDATED HEADER LAYOUT (FIXED & DARK) --- */
.main-header {
    /* CHANGED: Fixed Position, matching color, top alignment */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px; /* Explicit height */
    z-index: 1000;
    
    background-color: var(--nav-bar-color); 
    border-bottom: var(--nav-border);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
}

/* --- CHANGED: NEW LOGO CLASS FOR FILLET --- */
.header-logo {
    height: 50px;
    width: auto;
    border-radius: 12px; /* The rounded rectangle look */
}

/* --- Text Alignment within Header --- */
.header-center { text-align: center; flex-grow: 1; }
.slogan-text { font-family: 'Arial', sans-serif; font-weight: bold; line-height: 1.2; display: inline-block; color: #f0f0f0; font-style: italic; }
.sub-text { display: block; font-size: 0.85em; color: #e0e0e0; }
/* --- MODAL POPUP STYLES (Fixes the visible "Challenge Rules" box) --- */

/* The background overlay - Hidden by default */
.modal-overlay {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 2000; /* Sit on top of everything (including nav bar) */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.8); /* Black w/ opacity */
    backdrop-filter: blur(5px); /* Optional: blurs background for focus */
}

/* The modal content box */
.modal-content {
    background-color: #1e1e1e; /* Match existing dark card theme */
    margin: 10% auto; /* 10% from the top and centered */
    padding: 25px;
    border: 1px solid #444;
    width: 90%; /* Responsive width */
    max-width: 500px; /* Maximum width */
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    position: relative;
    color: #e0e0e0;
}

/* Modal Header/Title */
.modal-title {
    margin-top: 0;
    margin-bottom: 15px;
    color: #fff;
    font-size: 1.3rem;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

/* Modal List Items */
.modal-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}
.modal-list li {
    padding: 5px 0;
    border-bottom: 1px solid #333;
    color: #ccc;
}
.modal-list li:last-child {
    border-bottom: none;
}

/* Modal Action Buttons Area */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #444;
}
/* --- HAMBURGER MENU DROPDOWN STYLES --- */

/* The Container */
.dropdown {
    position: relative;
    display: inline-block;
}

/* The Hamburger Button */
.dropbtn {
    background-color: transparent;
    color: white;
    padding: 10px;
    font-size: 24px; /* Size of the hamburger icon */
    border: none;
    cursor: pointer;
    transition: color 0.3s;
}

/* Hover effect for the button */
.dropbtn:hover, .dropbtn:focus {
    color: #fd7e14; /* Orange accent */
    outline: none;
}

/* The Dropdown Content (Hidden by Default) */
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 50px; /* Pushes it slightly below the header */
    background-color: #1e1e1e; /* Dark Card Background */
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    border: 1px solid #444;
    border-radius: 8px;
    z-index: 1005; /* MUST be higher than the header (1000) */
    overflow: hidden;
}

/* Links inside the dropdown */
.dropdown-content a {
    color: #e0e0e0;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 1rem;
    border-bottom: 1px solid #333;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

/* Link Hover Effects */
.dropdown-content a:hover {
    background-color: #333;
    color: #fff;
}

/* The class JS will add to show the menu */
.show {
    display: block;
}
.error-message {
    color: #ff6b6b;
    background-color: rgba(220, 53, 69, 0.15);
    border: 1px solid #dc3545;
    padding: 12px;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 15px;
}
/* --- ABOUT SECTION SPECIFIC STYLES --- */
.about-section { max-width: 1000px; margin: 80px auto 40px auto; text-align: center; }
.about-title { font-size: 2.2rem; font-weight: 900; color: #fff; margin-bottom: 15px; margin-top: 0; }
.about-intro { color: #aaa; font-size: 1.05rem; line-height: 1.6; max-width: 800px; margin: 0 auto 40px auto; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; text-align: left; }
.feature-card { background-color: #1e1e1e; border: 1px solid #333; border-radius: 12px; padding: 25px; transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease; }
.feature-card:hover { transform: translateY(-5px); border-color: #fd7e14; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.feature-icon { width: 40px; height: 40px; margin-bottom: 15px; color: #fd7e14; }
.feature-card h3 { color: #fff; font-size: 1.25rem; margin-top: 0; margin-bottom: 10px; }
.feature-card p { color: #888; font-size: 0.95rem; line-height: 1.5; margin: 0; }