:root {
    --primary-color: #0D47A1;
    --secondary-color: #1565C0;
    --accent-color: #FF6B9D;
    --dark-color: #1A1A2E;
    --light-color: #F8F9FA;
    --success-color: #00C9A7;
    --warning-color: #FFB800;
    --danger-color: #FF3864;
    --gradient-start: #1565C0;
    --gradient-end: #01579B;
    --card-shadow: rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0A2342 0%, #0D47A1 50%, #01579B 100%);
    min-height: 100vh;
    color: var(--dark-color);
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    padding: 1rem 2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    position: relative;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    height: 32px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-avatar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 8px;
}

.nav-avatar-link:hover {
    transform: scale(1.05);
}

.nav-avatar {
    width: 60px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #4ECDC4;
    object-fit: cover;
    cursor: pointer;
    transition: border-color 0.2s;
}

.nav-avatar-link:hover .nav-avatar {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.nav-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s;
}

.nav-avatar-link:hover .nav-avatar-placeholder {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.user-name {
    color: var(--secondary-color);
    font-weight: 600;
}

.btn-logout {
    background: #B3D9FF;
    color: #0D47A1;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #99CCFF;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(179, 217, 255, 0.5);
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.auth-box {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.2);
    max-width: 450px;
    width: 100%;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-box h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #E8E9ED;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.2);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(13, 71, 161, 0.5);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.error-message {
    background: #FFE5EE;
    color: var(--danger-color);
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 1rem;
    display: none;
}

/* Dashboard */
.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.welcome-section {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px var(--card-shadow);
}

.welcome-section h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.motivational-quote {
    color: var(--secondary-color);
    font-size: 1.2rem;
    font-style: italic;
}

.summary-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px var(--card-shadow);
}

.summary-card h2 {
    color: var(--dark-color);
    margin-bottom: 1.5rem;
}

#daily-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 15px;
    color: white;
    box-shadow: 0 4px 20px rgba(13, 71, 161, 0.4);
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #FF8C42;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-btn {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.action-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.action-btn .icon {
    font-size: 2rem;
}

.workouts-section {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px var(--card-shadow);
}

.workouts-section h2 {
    color: var(--dark-color);
    margin-bottom: 1.5rem;
}

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filters select {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
}

.btn-favorites {
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.workouts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.workout-card {
    background: white;
    border: 2px solid #F0F2F5;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--card-shadow);
}

.workout-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(13, 71, 161, 0.35);
    border-color: var(--primary-color);
}

.workout-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.workout-card-content {
    padding: 1rem;
}

.workout-card h3 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.workout-meta {
    display: flex;
    justify-content: space-between;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.level-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.level-beginner {
    background: #D1F4E0;
    color: #00875A;
}

.level-intermediate {
    background: #FFF4D6;
    color: #974F00;
}

.level-advanced {
    background: #FFE5EE;
    color: #C9184A;
}

.level-relaxation {
    background: #E0F2FE;
    color: #0369A1;
}

.level-information {
    background: #f0f0f0;
    color: #333;
}

/* Video Tabs */
.video-tabs {
    display: flex;
    gap: 8px;
    margin: 30px 0 0 0;
    background: transparent;
    padding: 0 0 4px 0;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.2em;
    font-weight: 700;
    color: #1A1A2E;
    background: white;
    border: none;
    border-bottom: 4px solid #E8E9ED;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: -3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tab-btn:hover {
    color: var(--primary-color);
    background: #F8F9FA;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.3);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: white;
    box-shadow: 0 4px 16px rgba(13, 71, 161, 0.35);
}

.tab-count {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 0.9em;
    font-weight: 700;
    margin-left: 10px;
    min-width: 28px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(13, 71, 161, 0.45);
}

.tab-btn:not(.active) .tab-count {
    background: #9E9E9E;
    color: white;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.community-section {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

#community-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.community-card {
    padding: 1rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 12px;
    color: white;
}

/* Virtual Space */
.virtual-space-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.space-header {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* Summary Row Layout */
.summary-row {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: start !important;
}

/* Avatar section should fit content */
.summary-row .avatar-section {
    height: fit-content !important;
}

/* All three top cards have same height */
.summary-row > .summary-section {
    display: flex;
    flex-direction: column;
}

.summary-section {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.summary-section.personal-summary {
    background: #4ECDC4;
}

.summary-section h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
    font-size: 1.1rem;
}

/* Tooltip component for accessible inline help */
.info-tooltip {
    display: inline-block;
    position: relative;
    line-height: 1;
    margin-left: 0.5rem;
    cursor: help;
    color: var(--dark-color);
}
.info-tooltip .tooltip-text {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100% + 8px);
    background: rgba(33,33,33,0.95);
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    z-index: 2000;
}
.info-tooltip .tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(33,33,33,0.95) transparent transparent transparent;
}
.info-tooltip:focus .tooltip-text,
.info-tooltip:hover .tooltip-text {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 0.75rem;
    background: var(--light-color);
    border-radius: 8px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FF8C42;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.avatar-frame {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    /* Let avatar frame shrink to fit content, not stretch */
    min-height: 80px;
}

.avatar-frame img {
    width: 100%;
    height: auto;
    max-height: 100%;
    border-radius: 10px;
    object-fit: contain;
    border: 3px solid var(--primary-color);
}

.avatar-placeholder {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1;
    border-radius: 10px;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7f8c8d;
    font-size: 0.9rem;
    text-align: center;
}

.avatar-action {
    display: block;
    text-align: center;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s;
}

.avatar-action:hover {
    background: var(--light-color);
}

.timer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.timer-container {
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(13, 71, 161, 0.4);
}

.timer-section-compact {
    text-align: center;
}

.timer-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.timer-display-compact {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin: 0.3rem 0;
    font-family: 'Courier New', monospace;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.timer-btn-compact {
    padding: 0.4rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
    background: white;
    color: #667eea;
    margin-top: 0.3rem;
}

.timer-btn-compact:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.timer-btn-compact.timer-running {
    background: #e74c3c;
    color: white;
}

/* Make the stopwatch more prominent when placed in the personal summary */
.personal-summary .timer-display-compact,
.stopwatch-container .timer-display-compact {
    background: white; /* high contrast against personal-summary gradient */
    color: var(--secondary-color);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 1.15rem;
    font-weight: 800;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    min-width: 72px;
    text-align: center;
}

.personal-summary .timer-label {
    color: rgba(255,255,255,0.95);
}

.personal-summary .timer-btn-compact,
.stopwatch-container .timer-btn-compact {
    background: white;
    color: var(--secondary-color);
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.personal-summary .timer-btn-compact.timer-running,
.stopwatch-container .timer-btn-compact.timer-running {
    background: var(--danger-color);
    color: white;
    box-shadow: 0 8px 22px rgba(231,76,60,0.25);
}

.timer-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0.8rem 0;
}

.timer-input-group {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.timer-input {
    width: 50px;
    padding: 0.4rem;
    border: none;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.timer-display {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin: 0.5rem 0;
    font-family: 'Courier New', monospace;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.timer-btn-primary {
    padding: 0.6rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
    background: white;
    color: #667eea;
    margin-top: 0.5rem;
}

.timer-btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.timer-btn-primary.timer-running {
    background: #e74c3c;
    color: white;
}

.timer-display-large {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.5rem 0;
    font-family: 'Courier New', monospace;
}

.timer-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.timer-btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    background: var(--success-color);
    color: white;
}

.timer-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

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

.community-list {
    /* Allow community list to grow and fill its parent container.
       The parent `.community-summary` is set to use flex layout so this
       element can expand to take available vertical space and scroll when needed. */
    max-height: none;
    overflow-y: auto;
    padding-right: 6px; /* avoid touching scrollbar */
}

/* Make the community summary card layout fill its column vertically so
   the list can use the full height instead of leaving empty space at the bottom. */
.summary-section.community-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-section.community-summary .community-list {
    flex: 1 1 auto;
}

/* Compact community list items: reduce vertical space and font sizes so more items fit */
.community-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
}
.community-item:last-child {
    border-bottom: none;
}
.community-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex: 0 0 40px;
    object-fit: cover;
}
.community-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.community-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark-color);
}
.community-stats {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.actions-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

@media (max-width: 968px) {
    .summary-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.space-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-leave {
    padding: 0.5rem 1rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.active-users-panel {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.avatars-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.user-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: bounceIn 0.5s;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.avatar-image {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    font-weight: 700;
    object-fit: cover;
}

.avatar-image.active {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(78, 205, 196, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(78, 205, 196, 0);
    }
}

.avatar-name {
    font-size: 0.85rem;
    color: var(--dark-color);
}

.workout-player-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.video-container {
    margin-top: 1.5rem;
}

#video-player {
    background: #000;
    border-radius: 12px;
    aspect-ratio: 16/9;
    margin-bottom: 1rem;
}

.workout-timer {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
}

.timer-display {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.timer-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.intensity-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.activity-feed {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.feed-message {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--light-color);
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.feed-message.join {
    border-left-color: var(--success-color);
}

.feed-message.leave {
    border-left-color: var(--warning-color);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal[style*="display: block"] {
    display: flex;
}

.modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    /* Allow wide modal but remain responsive on small screens */
    max-width: 900px;
    width: 95%;
    overflow-y: auto;
    position: relative;
    animation: zoomIn 0.3s;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Video preview container used by the share/upload modal */
#video-embed-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 8px;
    margin: 0 auto;
}

#video-preview, .video-preview {
    display: none;
    margin: 20px auto 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    max-width: 760px;
}

.input-error {
    color: #b00020;
    display: block;
    margin-top: 6px;
    font-size: 0.92em;
}

/* Toast notifications (top-right) */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    min-width: 240px;
    max-width: 420px;
    background: white;
    color: var(--dark-color);
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    font-weight: 600;
    opacity: 0;
    transform: translateY(-6px);
    animation: toastIn 220ms ease forwards;
}
.toast.success { border-left: 6px solid var(--success-color); }
.toast.error { border-left: 6px solid var(--danger-color); }

@keyframes toastIn {
    to { opacity: 1; transform: translateY(0); }
}

.toast.fadeOut {
    transition: opacity 220ms ease, transform 220ms ease;
    opacity: 0 !important;
    transform: translateY(-8px) !important;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content.celebration {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    text-align: center;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    margin: 0.5rem 0;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

.result-label {
    font-weight: 600;
}

.result-value {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 968px) {
    .navbar {
        padding: 1rem;
    }

    .nav-container {
        position: relative;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        gap: 0;
        padding: 80px 2rem 2rem;
        box-shadow: -4px 0 30px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1000;
        align-items: flex-start;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a,
    .nav-links .user-name {
        width: 100%;
        padding: 1rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        font-size: 1rem;
    }

    .nav-links .nav-avatar {
        margin: 1rem 0;
        width: 80px;
        height: 53px;
    }

    .nav-links .btn-logout {
        margin-top: 1rem;
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem;
    }

    .main-content {
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .logo {
        font-size: 1.2rem;
    }

    .nav-links {
        width: 100%;
        right: -100%;
    }

    .nav-links.active {
        right: 0;
    }
    
    #daily-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-actions {
        grid-template-columns: 1fr 1fr;
    }

    .auth-box {
        padding: 2rem 1.5rem;
        margin: 0 1rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1rem;
    }

    .nav-links a,
    .nav-links .user-name {
        font-size: 0.95rem;
        padding: 0.875rem 0;
    }

    #daily-stats {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }
}
