/* Slate Theme - Landing Page Styles */

/* Update root colors to neutral/slate theme */
:root {
    --color-sky-gradient: linear-gradient(135deg, #E2E8F0 0%, #CBD5E1 25%, #D1D9E6 50%, #B8C5D4 75%, #94A3B8 100%);
    --color-primary-blue: #475569;
    --color-primary-dark-blue: #334155;
    --color-text-dark: #1E293B;
    --color-text-medium: #475569;
    --color-text-muted-blue: #64748B;
    --color-accent-blue: #64748B;

    /* Override base theme variables */
    --color-primary: #475569;
    --color-primary-dark: #334155;
    --color-primary-light: #64748B;
    --color-primary-gradient: linear-gradient(135deg, #475569 0%, #334155 100%);
    --color-bg: linear-gradient(135deg, #E2E8F0 0%, #94A3B8 100%);
    --color-bg-solid: #E2E8F0;
    --color-text: #1E293B;
    --color-text-muted: #64748B;
    --color-border: #E2E8F0;
    --color-surface: #F1F5F9;
    --color-surface-glass: rgba(255, 255, 255, 0.8);
}

/* Body background */
body {
    background: #E2E8F0 !important;
}

/* Landing overlay - slate gradient */
.landing-overlay {
    background: var(--color-sky-gradient) !important;
    background-size: 200% 200%;
    animation: skyShift 20s ease infinite;
}

@keyframes skyShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Hero Section - clean white glass */
.landing-hero {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(20px) !important;
    border-radius: 24px !important;
    padding: 48px 40px !important;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06) !important;
    margin: 0 auto 20px !important;
    border: none !important;
}

.hero-headline {
    font-size: 56px !important;
    font-weight: 700 !important;
    color: #1E293B !important;
    line-height: 1.15 !important;
    margin: 0 0 24px !important;
    letter-spacing: -0.5px !important;
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    text-align: center !important;
}

.hero-headline-accent {
    color: #475569;
}

.hero-subtitle {
    font-size: 20px !important;
    color: #475569 !important;
    margin: 0 0 32px !important;
    font-weight: 400 !important;
}

.hero-subtitle strong {
    font-weight: 600;
}

.hero-link {
    color: #475569;
    text-decoration: underline;
}

.cta-button-hero {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 32px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(51, 65, 85, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(51, 65, 85, 0.4);
}

/* Hero Mode Buttons */
.hero-mode-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
}

.hero-mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 32px;
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(51, 65, 85, 0.3);
    transition: all 0.3s ease;
    min-width: 180px;
}

.hero-mode-btn svg {
    width: 32px;
    height: 32px;
}

.hero-mode-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(51, 65, 85, 0.4);
}

.hero-mode-btn:active {
    transform: translateY(-2px);
}

/* How It Works Section */
.how-it-works {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(20px) !important;
    border-radius: 24px !important;
    padding: 36px 40px !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06) !important;
    margin-bottom: 20px !important;
    border: none !important;
}

.how-it-works-title {
    font-size: 28px;
    font-weight: 600;
    color: #1E293B;
    text-align: center;
    margin: 0 0 40px;
}

.how-it-works-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    position: relative;
}

.connecting-line {
    position: absolute;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, #CBD5E1, #94A3B8, #CBD5E1);
    z-index: 0;
}

.step-item {
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-icon-circle {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.step-icon {
    width: 32px;
    height: 32px;
    color: #475569;
}

.step-title {
    font-size: 17px;
    font-weight: 600;
    color: #1E293B;
    margin: 0 0 12px;
}

.step-desc {
    font-size: 15px;
    color: #64748B;
    margin: 0;
    line-height: 1.5;
}

/* Mode Cards */
.mode-cards {
    margin-bottom: 40px;
}

.mode-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.mode-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}

.mode-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.mode-card-voice {
    background: linear-gradient(135deg, rgba(226, 232, 240, 0.9) 0%, rgba(203, 213, 225, 0.85) 100%);
}

.mode-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.mode-card-icon {
    width: 44px;
    height: 32px;
    background: linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mode-card-voice .mode-card-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
}

.mode-card-icon svg {
    width: 24px;
    height: 24px;
    color: #475569;
}

.mode-card-voice .mode-card-icon svg {
    width: 22px;
    height: 22px;
    color: #334155;
}

.mode-card-title {
    font-size: 24px;
    font-weight: 600;
    color: #1E293B;
    margin: 0;
}

.mode-card-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mode-card-list li {
    font-size: 16px;
    color: #475569;
    padding: 8px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.mode-card-voice .mode-card-list li {
    color: #334155;
}

.list-number {
    color: #475569;
    font-weight: 600;
}

.mode-card-voice .list-number {
    color: #334155;
}

/* ===== TOOL PAGES (WRITING & VOICE APPS) - SLATE THEME ===== */

/* App container background - match landing page */
.app-container {
    background: var(--color-sky-gradient) !important;
    background-size: 200% 200%;
    animation: skyShift 20s ease infinite;
}

/* Controls sidebar - slate gradient theme */
.controls-section {
    background: linear-gradient(180deg, rgba(71, 85, 105, 0.15) 0%, rgba(51, 65, 85, 0.1) 100%) !important;
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* Writing/Voice section - white with subtle slate tint */
.writing-section,
.voice-section {
    background: rgba(255, 255, 255, 0.95) !important;
}

/* Header stats - slate themed */
.header-stats {
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.1) 0%, rgba(51, 65, 85, 0.08) 100%) !important;
    border: 1px solid rgba(71, 85, 105, 0.2) !important;
}

/* Timer and word count values */
.stat-value {
    color: #475569 !important;
}

/* Primary buttons - match hero buttons */
.control-btn.primary {
    background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.3) !important;
    font-weight: 600 !important;
}

.control-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(51, 65, 85, 0.4) !important;
}

.control-btn.primary:disabled {
    opacity: 0.5;
    transform: none;
}

/* Secondary control buttons */
.control-btn {
    border: 2px solid rgba(71, 85, 105, 0.3) !important;
    color: #475569 !important;
    background: rgba(255, 255, 255, 0.9) !important;
}

.control-btn:hover:not(:disabled) {
    border-color: #475569 !important;
    background: rgba(255, 255, 255, 1) !important;
}

/* Mode toggle container */
.mode-toggle-prominent {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 2px solid rgba(71, 85, 105, 0.2) !important;
}

/* Mode toggle buttons */
.mode-toggle-btn-prominent {
    background: rgba(255, 255, 255, 0.4) !important;
    border: 2px solid rgba(71, 85, 105, 0.15) !important;
    color: #64748B !important;
}

.mode-toggle-btn-prominent.active {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(71, 85, 105, 0.3) !important;
    color: #334155 !important;
    box-shadow: 0 2px 8px rgba(71, 85, 105, 0.15) !important;
}

.mode-toggle-btn-prominent:hover:not(.active) {
    border-color: rgba(71, 85, 105, 0.25) !important;
    background: rgba(255, 255, 255, 0.6) !important;
}

/* SVG icons in mode toggle buttons */
.mode-toggle-icon-prominent {
    width: 32px !important;
    height: 32px !important;
    stroke: currentColor;
}

.mode-toggle-btn-prominent.active .mode-toggle-icon-prominent {
    stroke: #475569;
}

/* Input fields */
input[type="number"],
.momentum-select,
.voice-topic-input {
    border-color: rgba(71, 85, 105, 0.3) !important;
}

input[type="number"]:focus,
.momentum-select:focus,
.voice-topic-input:focus {
    border-color: #475569 !important;
    box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.1) !important;
}

/* Toggle switches */
input:checked+.slider {
    background-color: #475569 !important;
}

/* Control group headings */
.control-group h3,
.section-header h3 {
    color: #334155 !important;
}

/* Writing footer */
.writing-footer,
.voice-footer {
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.08) 0%, rgba(51, 65, 85, 0.05) 100%) !important;
    border-top-color: rgba(71, 85, 105, 0.2) !important;
}

/* User avatar - slate theme */
.user-avatar {
    background: #475569 !important;
}

/* Logo icon should be dark to match black icon */
.logo-icon {
    color: #1E293B !important;
}

/* ===== USER DROPDOWN MENU - SLATE THEME ===== */
.user-dropdown {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.15) !important;
}

.user-dropdown-name {
    color: #1E293B !important;
}

.user-dropdown-email {
    color: #64748B !important;
}

.user-dropdown-divider {
    background: #E2E8F0 !important;
}

.user-dropdown-item {
    color: #334155 !important;
}

.user-dropdown-item:hover {
    background-color: #F1F5F9 !important;
}

.dropdown-icon {
    color: #64748B !important;
}

.dropdown-chevron {
    color: #64748B !important;
}

/* ===== NAVBAR - SLATE THEME ===== */
.app-header,
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 1px solid #E2E8F0 !important;
    backdrop-filter: blur(10px) !important;
}

.nav-link {
    color: #475569 !important;
}

.nav-link:hover,
.nav-link.active {
    color: #1E293B !important;
}

/* ===== DASHBOARD PAGE - SLATE THEME ===== */
.dashboard-container {
    background: transparent !important;
}

.dashboard-header h1 {
    color: #1E293B !important;
}

.dashboard-header p {
    color: #64748B !important;
}

/* Dashboard cards */
.dashboard-card,
.stats-card,
.stat-card {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 2px 8px rgba(51, 65, 85, 0.08) !important;
}

.stat-card h3,
.stat-label {
    color: #64748B !important;
}

.stat-value {
    color: #1E293B !important;
}

/* ===== ACCOUNT PAGE - SLATE THEME ===== */
.account-container,
.settings-container {
    background: transparent !important;
}

.account-section,
.settings-section {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
}

.account-section h2,
.settings-section h2,
.section-title {
    color: #1E293B !important;
}

.account-label,
.settings-label {
    color: #64748B !important;
}

.account-value,
.settings-value {
    color: #334155 !important;
}

/* ===== BUTTONS ACROSS ALL PAGES - SLATE THEME ===== */
.btn-primary,
.primary-btn,
button.primary {
    background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.25) !important;
}

.btn-primary:hover,
.primary-btn:hover,
button.primary:hover {
    box-shadow: 0 6px 16px rgba(51, 65, 85, 0.35) !important;
}

.btn-secondary,
.secondary-btn,
button.secondary {
    background: white !important;
    color: #475569 !important;
    border: 2px solid #CBD5E1 !important;
}

.btn-secondary:hover,
.secondary-btn:hover,
button.secondary:hover {
    border-color: #475569 !important;
    background: #F8FAFC !important;
}

/* ===== LINKS - SLATE THEME ===== */
a {
    color: #475569;
}

a:hover {
    color: #334155;
}

/* ===== FORMS AND INPUTS - SLATE THEME ===== */
input,
textarea,
select {
    border-color: #CBD5E1 !important;
    color: #1E293B !important;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #475569 !important;
    box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.1) !important;
    outline: none !important;
}

input::placeholder,
textarea::placeholder {
    color: #94A3B8 !important;
}

/* ===== GROUPS PAGE - SLATE THEME ===== */
.groups-container {
    background: transparent !important;
}

.group-card {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 2px 8px rgba(51, 65, 85, 0.08) !important;
}

.group-card:hover {
    box-shadow: 0 4px 16px rgba(51, 65, 85, 0.12) !important;
}

.group-name {
    color: #1E293B !important;
}

.group-stats {
    color: #64748B !important;
}

/* ===== HISTORY PAGE - SLATE THEME ===== */
.history-container {
    background: transparent !important;
}

.history-item,
.session-card {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #E2E8F0 !important;
}

.history-date,
.session-date {
    color: #64748B !important;
}

.history-stats,
.session-stats {
    color: #475569 !important;
}

/* ===== MODALS - SLATE THEME ===== */
.modal-overlay {
    background: rgba(30, 41, 59, 0.5) !important;
}

.modal-content,
.modal {
    background: white !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 8px 32px rgba(51, 65, 85, 0.2) !important;
}

.modal-header h2,
.modal-title {
    color: #1E293B !important;
}

.modal-close {
    color: #64748B !important;
}

.modal-close:hover {
    color: #334155 !important;
}

/* ===== TABS - SLATE THEME ===== */
.tab-btn,
.tab-link {
    color: #64748B !important;
    border-bottom: 2px solid transparent !important;
}

.tab-btn.active,
.tab-link.active {
    color: #1E293B !important;
    border-bottom-color: #475569 !important;
}

.tab-btn:hover,
.tab-link:hover {
    color: #334155 !important;
}

/* ===== BADGES AND TAGS - SLATE THEME ===== */
.badge,
.tag {
    background: #F1F5F9 !important;
    color: #475569 !important;
}

.badge-primary,
.tag-primary {
    background: #475569 !important;
    color: white !important;
}

/* ===== TOOLTIPS - SLATE THEME ===== */
.tooltip {
    background: #334155 !important;
    color: white !important;
}

/* ===== PROGRESS BARS - SLATE THEME ===== */
.progress-bar {
    background: #E2E8F0 !important;
}

.progress-fill {
    background: linear-gradient(90deg, #475569, #64748B) !important;
}

/* ===== SCROLLBARS - SLATE THEME ===== */
::-webkit-scrollbar-thumb {
    background: #CBD5E1 !important;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8 !important;
}

::-webkit-scrollbar-track {
    background: #F1F5F9 !important;
}

/* ===== DASHBOARD MODE BOXES - SLATE THEME ===== */
.mode-box {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 4px 16px rgba(51, 65, 85, 0.08) !important;
}

.mode-box-primary {
    border-left: 4px solid #475569 !important;
    border-image: none !important;
}

.mode-box-secondary {
    border-left: 4px solid #64748B !important;
    border-image: none !important;
}

.mode-header-button {
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.08) 0%, rgba(51, 65, 85, 0.05) 100%) !important;
    border: 2px solid #CBD5E1 !important;
}

.mode-header-button:hover {
    border-color: #475569 !important;
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.15) !important;
}

.mode-title {
    color: #1E293B !important;
}

.mode-icon img {
    filter: grayscale(100%) brightness(0.4) !important;
}

/* Dashboard section titles */
.dashboard-section-title,
.dashboard-actions h2 {
    color: #1E293B !important;
}

/* Dashboard title */
.dashboard-title {
    color: #1E293B !important;
}

/* Stat cards on dashboard */
.stat-card {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #E2E8F0 !important;
    cursor: pointer;
    transition: all 0.2s ease !important;
}

.stat-card:hover {
    border-color: #CBD5E1 !important;
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.1) !important;
}

.stat-card .stat-value {
    color: #1E293B !important;
    font-weight: 700 !important;
}

.stat-card .stat-label {
    color: #64748B !important;
}

/* Stat detail panel */
.stat-detail-panel {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 4px 16px rgba(51, 65, 85, 0.1) !important;
}

.stat-detail-title {
    color: #1E293B !important;
}

.stat-detail-definition {
    color: #64748B !important;
}

.stat-detail-close {
    color: #64748B !important;
}

.stat-detail-close:hover {
    color: #334155 !important;
}

/* Groups section */
.groups-header {
    border-bottom-color: #E2E8F0 !important;
}

.groups-empty-state {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 2px dashed #CBD5E1 !important;
}

.groups-empty-state h3 {
    color: #1E293B !important;
}

.groups-empty-state p {
    color: #64748B !important;
}

/* Button styles */
.btn {
    transition: all 0.2s ease !important;
}

.btn-primary {
    background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
    color: white !important;
    border: none !important;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.25) !important;
}

.btn-secondary {
    background: white !important;
    color: #475569 !important;
    border: 2px solid #CBD5E1 !important;
}

.btn-secondary:hover {
    border-color: #475569 !important;
    background: #F8FAFC !important;
}

/* ===== ACCOUNT PAGE - SLATE THEME ===== */
.account-title {
    color: #1E293B !important;
}

.account-section {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
}

.account-section h2 {
    color: #1E293B !important;
}

.account-info-row {
    border-bottom-color: #E2E8F0 !important;
}

.account-label {
    color: #64748B !important;
}

.account-value {
    color: #334155 !important;
}

.account-actions-grid .btn {
    border-color: #CBD5E1 !important;
    color: #475569 !important;
}

.account-actions-grid .btn:hover {
    border-color: #475569 !important;
    background: #F8FAFC !important;
}

/* Danger zone */
.account-section .btn-danger,
.delete-account-btn {
    background: #DC2626 !important;
    color: white !important;
}

/* Session history */
.session-item {
    border-bottom-color: #E2E8F0 !important;
}

.session-date {
    color: #64748B !important;
}

.session-stats {
    color: #475569 !important;
}

/* ===== GROUPS SECTION BUTTONS - FIX SIZING & HOVER ===== */
.groups-actions .btn,
.groups-header .btn {
    font-size: 1rem !important;
    padding: 0.75rem 1.25rem !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    transform: translateY(0) !important;
}

.groups-actions .btn:hover,
.groups-header .btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.2) !important;
}

.groups-actions .btn:active,
.groups-header .btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(51, 65, 85, 0.15) !important;
}

.groups-empty-state .btn {
    font-size: 1rem !important;
    padding: 0.875rem 1.5rem !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    transform: translateY(0) !important;
}

.groups-empty-state .btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(51, 65, 85, 0.2) !important;
}

.groups-empty-state .btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(51, 65, 85, 0.15) !important;
}

/* Primary button style for groups */
.groups-actions .btn-primary,
.groups-header .btn-primary,
.groups-empty-state .btn-primary {
    background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
    color: white !important;
    border: none !important;
}

.groups-actions .btn-primary:hover,
.groups-header .btn-primary:hover,
.groups-empty-state .btn-primary:hover {
    background: linear-gradient(135deg, #334155 0%, #1E293B 100%) !important;
}

/* Secondary/outline button style for groups */
.groups-actions .btn-secondary,
.groups-header .btn-secondary,
.groups-empty-state .btn-secondary {
    background: white !important;
    color: #475569 !important;
    border: 2px solid #CBD5E1 !important;
}

.groups-actions .btn-secondary:hover,
.groups-header .btn-secondary:hover,
.groups-empty-state .btn-secondary:hover {
    border-color: #475569 !important;
    background: #F8FAFC !important;
}

/* ===== GROUP MODALS - FIX POSITIONING ===== */
.group-modal,
#create-group-modal,
#join-group-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(30, 41, 59, 0.7) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 10000 !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
}

.group-modal.active,
.group-modal[style*="display: flex"],
#create-group-modal[style*="display: flex"],
#join-group-modal[style*="display: flex"] {
    display: flex !important;
}

.group-modal-content {
    background: white !important;
    border-radius: 20px !important;
    padding: 2.5rem 3rem !important;
    max-width: 520px !important;
    width: calc(100% - 2rem) !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    box-shadow: 0 25px 80px rgba(30, 41, 59, 0.4) !important;
    position: relative !important;
    margin: auto !important;
    animation: modalSlideIn 0.3s ease-out !important;
    box-sizing: border-box !important;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.group-modal-header {
    text-align: center !important;
    margin-bottom: 1.75rem !important;
}

.group-modal-icon {
    width: 64px !important;
    height: 64px !important;
    margin: 0 auto 1rem !important;
    background: linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%) !important;
    border-radius: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.group-modal-icon svg {
    width: 32px !important;
    height: 32px !important;
    color: #475569 !important;
}

.group-modal-title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #1E293B !important;
    margin: 0 0 0.5rem 0 !important;
}

.group-modal-subtitle {
    font-size: 0.95rem !important;
    color: #64748B !important;
    margin: 0 !important;
    line-height: 1.5 !important;
}

.group-form-label .required {
    color: #DC2626 !important;
    font-weight: 600 !important;
}

.group-form-label .optional {
    color: #94A3B8 !important;
    font-weight: 400 !important;
    font-size: 0.85rem !important;
}

.group-form-group {
    margin-bottom: 1.25rem !important;
}

.group-form-label {
    display: block !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: #334155 !important;
    margin-bottom: 0.5rem !important;
}

.group-form-input,
.group-modal input,
.group-modal textarea {
    width: 100% !important;
    font-size: 1rem !important;
    font-family: inherit !important;
    padding: 0.875rem 1rem !important;
    border: 2px solid #E2E8F0 !important;
    border-radius: 10px !important;
    background: #F8FAFC !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
}

.group-modal textarea {
    resize: vertical !important;
    min-height: 80px !important;
    line-height: 1.5 !important;
}

.group-form-input:focus,
.group-modal input:focus,
.group-modal textarea:focus {
    border-color: #475569 !important;
    background: white !important;
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(71, 85, 105, 0.1) !important;
}

.group-form-hint {
    font-size: 0.85rem !important;
    color: #94A3B8 !important;
    margin-top: 0.375rem !important;
}

.group-modal-actions {
    display: flex !important;
    gap: 1rem !important;
    margin-top: 2rem !important;
}

.group-modal-actions .btn {
    flex: 1 !important;
    font-size: 1rem !important;
    padding: 1rem 1.5rem !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.group-modal-actions .btn:hover {
    transform: translateY(-1px) !important;
}

.group-modal-actions .btn:active {
    transform: translateY(0) !important;
}

.group-modal-actions .btn-primary {
    background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
    color: white !important;
    border: none !important;
}

.group-modal-actions .btn-primary:hover {
    background: linear-gradient(135deg, #334155 0%, #1E293B 100%) !important;
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.3) !important;
}

.group-modal-actions .btn-secondary {
    background: white !important;
    color: #64748B !important;
    border: 2px solid #E2E8F0 !important;
}

.group-modal-actions .btn-secondary:hover {
    border-color: #CBD5E1 !important;
    background: #F8FAFC !important;
}

.group-modal-close {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    width: 36px !important;
    height: 36px !important;
    border: none !important;
    background: #F1F5F9 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    color: #64748B !important;
    font-size: 1.25rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.group-modal-close:hover {
    background: #E2E8F0 !important;
    color: #334155 !important;
}

.group-form-error {
    color: #DC2626 !important;
    font-size: 0.875rem !important;
    margin-top: 0.75rem !important;
    padding: 0.75rem 1rem !important;
    background: #FEF2F2 !important;
    border-radius: 8px !important;
    border-left: 3px solid #DC2626 !important;
    display: none !important;
}

.group-form-error:not(:empty) {
    display: block !important;
}

/* ===== GROUP DETAIL PAGE STYLES ===== */

.group-dashboard {
    max-width: 1000px !important;
    margin: 0 auto !important;
    padding: 2rem !important;
}

.group-detail-header {
    margin-bottom: 1.5rem !important;
}

.group-detail-header .btn-back {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    background: transparent !important;
    border: none !important;
    color: #64748B !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    padding: 0.5rem 0 !important;
    margin-bottom: 1rem !important;
    transition: color 0.2s !important;
}

.group-detail-header .btn-back:hover {
    color: #334155 !important;
}

.group-detail-header .btn-back svg {
    flex-shrink: 0 !important;
}

.group-header-content {
    text-align: center !important;
}

.group-detail-name {
    font-size: 2rem !important;
    font-weight: 700 !important;
    color: #1E293B !important;
    margin: 0 0 0.5rem 0 !important;
}

.group-detail-desc {
    font-size: 1rem !important;
    color: #64748B !important;
    margin: 0 !important;
    max-width: 600px !important;
    margin: 0 auto !important;
}

/* Invite Code Card */
.invite-code-card {
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%) !important;
    border: 2px solid #E2E8F0 !important;
    border-radius: 16px !important;
    padding: 1.5rem 2rem !important;
    margin-bottom: 2rem !important;
    text-align: center !important;
}

.invite-code-header {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    color: #64748B !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.invite-code-header svg {
    color: #475569 !important;
}

.invite-code-display {
    margin-bottom: 1rem !important;
}

.invite-code-display code {
    font-family: 'SF Mono', 'Menlo', 'Monaco', monospace !important;
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    color: #1E293B !important;
    background: white !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 10px !important;
    border: 2px solid #CBD5E1 !important;
    display: inline-block !important;
    letter-spacing: 0.1em !important;
}

.invite-code-actions {
    display: flex !important;
    gap: 0.75rem !important;
    justify-content: center !important;
    margin-bottom: 0.75rem !important;
}

.invite-code-actions .btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.625rem 1rem !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.invite-code-actions .btn svg {
    flex-shrink: 0 !important;
}

.invite-code-actions .btn-primary {
    background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
    color: white !important;
    border: none !important;
}

.invite-code-actions .btn-primary:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.25) !important;
}

.invite-code-actions .btn-secondary {
    background: white !important;
    color: #475569 !important;
    border: 2px solid #CBD5E1 !important;
}

.invite-code-actions .btn-secondary:hover {
    border-color: #94A3B8 !important;
    background: #F8FAFC !important;
}

.invite-code-hint {
    font-size: 0.85rem !important;
    color: #94A3B8 !important;
    margin: 0 !important;
}

/* Section Titles */
.section-title {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #1E293B !important;
    margin: 0 0 1rem 0 !important;
}

/* Group Stats Grid */
.group-stats-section {
    margin-bottom: 2rem !important;
}

.group-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1rem !important;
}

.group-stat-card {
    background: white !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
    padding: 1.25rem !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 1rem !important;
    transition: all 0.2s ease !important;
}

.group-stat-card:hover {
    border-color: #CBD5E1 !important;
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.08) !important;
}

.group-stat-card.highlight {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%) !important;
    border-color: #F59E0B !important;
}

.group-stat-card .stat-icon {
    width: 40px !important;
    height: 40px !important;
    background: #F1F5F9 !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.group-stat-card.highlight .stat-icon {
    background: rgba(245, 158, 11, 0.2) !important;
}

.group-stat-card .stat-icon svg {
    width: 20px !important;
    height: 20px !important;
    color: #475569 !important;
}

.group-stat-card.highlight .stat-icon svg {
    color: #B45309 !important;
}

.group-stat-card .stat-content {
    flex: 1 !important;
}

.group-stat-card .stat-value {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #1E293B !important;
    line-height: 1.2 !important;
}

.group-stat-card .stat-label {
    font-size: 0.8rem !important;
    color: #64748B !important;
    margin-top: 0.25rem !important;
}

/* Mobile Responsive Stats */
@media (max-width: 768px) {
    .group-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .group-dashboard {
        padding: 1rem !important;
    }

    .invite-code-display code {
        font-size: 1.25rem !important;
        padding: 0.5rem 1rem !important;
    }

    .invite-code-actions {
        flex-direction: column !important;
    }

    .invite-code-actions .btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

@media (max-width: 480px) {
    .group-stats-grid {
        grid-template-columns: 1fr !important;
    }

    .group-detail-name {
        font-size: 1.5rem !important;
    }
}

/* ===== SECTION HEADERS ===== */
.section-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 1rem !important;
    flex-wrap: wrap !important;
    gap: 0.75rem !important;
}

.section-header h2 {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #1E293B !important;
    margin: 0 !important;
}

/* ===== CHALLENGES SECTION ===== */
.group-challenges-section {
    background: white !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 16px !important;
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.challenge-card {
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
    padding: 1.25rem !important;
    margin-bottom: 1rem !important;
}

.challenge-card:last-child {
    margin-bottom: 0 !important;
}

.challenge-card.completed {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%) !important;
    border-color: #10B981 !important;
}

.challenge-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 0.5rem !important;
}

.challenge-header h4 {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #1E293B !important;
    margin: 0 !important;
}

.challenge-badge {
    background: #10B981 !important;
    color: white !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    padding: 0.25rem 0.75rem !important;
    border-radius: 20px !important;
}

.challenge-desc {
    font-size: 0.95rem !important;
    color: #64748B !important;
    margin: 0 0 1rem 0 !important;
}

.challenge-progress {
    margin-bottom: 0.75rem !important;
}

.progress-bar {
    height: 8px !important;
    background: #E2E8F0 !important;
    border-radius: 4px !important;
    overflow: hidden !important;
    margin-bottom: 0.5rem !important;
}

.progress-fill {
    height: 100% !important;
    background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
    border-radius: 4px !important;
    transition: width 0.3s ease !important;
}

.progress-text {
    font-size: 0.9rem !important;
    color: #475569 !important;
    font-weight: 500 !important;
}

.challenge-deadline {
    font-size: 0.85rem !important;
    color: #94A3B8 !important;
    margin: 0 !important;
}

/* ===== GROUP PROGRESS SECTION (Collective Only) ===== */
.group-progress-section {
    background: white !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 16px !important;
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.group-progress-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1rem !important;
    margin-bottom: 1rem !important;
}

.progress-card {
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
    padding: 1.25rem !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 1rem !important;
}

.progress-icon {
    background: #E2E8F0 !important;
    border-radius: 10px !important;
    padding: 0.75rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.progress-icon svg {
    stroke: #475569 !important;
}

.progress-content {
    flex: 1 !important;
}

.progress-value {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #1E293B !important;
    line-height: 1.2 !important;
}

.progress-label {
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    color: #475569 !important;
    margin-top: 0.25rem !important;
}

.progress-hint {
    font-size: 0.75rem !important;
    color: #94A3B8 !important;
    margin-top: 0.25rem !important;
}

.progress-controls {
    display: flex !important;
    gap: 0.5rem !important;
}

.progress-controls select {
    padding: 0.5rem 0.75rem !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    color: #475569 !important;
    background: white !important;
    cursor: pointer !important;
}

.privacy-notice {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.75rem 1rem !important;
    background: #F0FDF4 !important;
    border: 1px solid #BBF7D0 !important;
    border-radius: 8px !important;
    font-size: 0.85rem !important;
    color: #166534 !important;
}

.privacy-notice svg {
    stroke: #16A34A !important;
    flex-shrink: 0 !important;
}

/* Mobile Responsive for Group Progress */
@media (max-width: 1024px) {
    .group-progress-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .group-progress-grid {
        grid-template-columns: 1fr !important;
    }

    .progress-card {
        flex-direction: column !important;
        text-align: center !important;
    }
}

/* ===== LEADERBOARD SECTION (DEPRECATED - Kept for backwards compat) ===== */
.group-leaderboard-section {
    background: white !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 16px !important;
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.leaderboard-controls {
    display: flex !important;
    gap: 0.5rem !important;
}

.leaderboard-controls select {
    font-size: 0.9rem !important;
    padding: 0.5rem 0.75rem !important;
    border: 1px solid #CBD5E1 !important;
    border-radius: 8px !important;
    background: white !important;
    color: #475569 !important;
    cursor: pointer !important;
}

.leaderboard-controls select:focus {
    outline: none !important;
    border-color: #475569 !important;
}

.leaderboard-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 1rem !important;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 0.875rem 1rem !important;
    text-align: left !important;
    font-size: 0.95rem !important;
}

.leaderboard-table th {
    font-weight: 600 !important;
    color: #64748B !important;
    border-bottom: 2px solid #E2E8F0 !important;
    font-size: 0.85rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.leaderboard-table td {
    color: #1E293B !important;
    border-bottom: 1px solid #F1F5F9 !important;
}

.leaderboard-table tr:last-child td {
    border-bottom: none !important;
}

.leaderboard-table .rank {
    font-weight: 700 !important;
    color: #64748B !important;
    width: 60px !important;
}

.leaderboard-table .name {
    font-weight: 500 !important;
}

.leaderboard-table .value {
    font-weight: 600 !important;
    color: #475569 !important;
    text-align: right !important;
}

.leaderboard-table tr.top-rank.rank-1 .rank {
    color: #F59E0B !important;
    font-size: 1.1rem !important;
}

.leaderboard-table tr.top-rank.rank-2 .rank {
    color: #94A3B8 !important;
}

.leaderboard-table tr.top-rank.rank-3 .rank {
    color: #CD7F32 !important;
}

.leaderboard-opt-in {
    margin-top: 1.25rem !important;
    padding-top: 1.25rem !important;
    border-top: 1px solid #E2E8F0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    flex-wrap: wrap !important;
}

.leaderboard-opt-in label {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-size: 0.95rem !important;
    color: #475569 !important;
    cursor: pointer !important;
}

.leaderboard-opt-in input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    accent-color: #475569 !important;
}

.leaderboard-opt-in input[type="text"] {
    font-size: 0.9rem !important;
    padding: 0.5rem 0.75rem !important;
    border: 1px solid #CBD5E1 !important;
    border-radius: 8px !important;
    flex: 1 !important;
    min-width: 150px !important;
}

.leaderboard-opt-in input[type="text"]:focus {
    outline: none !important;
    border-color: #475569 !important;
}

/* ===== ADMIN SECTION ===== */
.group-admin-section {
    background: white !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 16px !important;
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.group-admin-section h2 {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #1E293B !important;
    margin: 0 0 1.25rem 0 !important;
}

.admin-actions {
    display: flex !important;
    gap: 0.75rem !important;
    flex-wrap: wrap !important;
    margin-bottom: 1.25rem !important;
}

.admin-actions .btn {
    font-size: 0.95rem !important;
    padding: 0.75rem 1.25rem !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.admin-actions .btn-primary {
    background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
    color: white !important;
    border: none !important;
}

.admin-actions .btn-primary:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.25) !important;
}

.admin-actions .btn-secondary {
    background: white !important;
    color: #475569 !important;
    border: 2px solid #CBD5E1 !important;
}

.admin-actions .btn-secondary:hover {
    border-color: #94A3B8 !important;
    background: #F8FAFC !important;
}

/* Members List */
.members-list {
    margin-top: 1rem !important;
}

.member-row {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    padding: 1rem !important;
    background: #F8FAFC !important;
    border-radius: 10px !important;
    margin-bottom: 0.5rem !important;
}

.member-row:last-child {
    margin-bottom: 0 !important;
}

.member-name {
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #1E293B !important;
    flex: 1 !important;
}

.member-role {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    padding: 0.25rem 0.75rem !important;
    border-radius: 20px !important;
    text-transform: uppercase !important;
}

.member-role.admin {
    background: #DBEAFE !important;
    color: #1D4ED8 !important;
}

.member-role.member {
    background: #F1F5F9 !important;
    color: #64748B !important;
}

.member-joined {
    font-size: 0.85rem !important;
    color: #94A3B8 !important;
}

.btn-remove-member {
    font-size: 0.85rem !important;
    padding: 0.375rem 0.75rem !important;
    background: #FEF2F2 !important;
    color: #DC2626 !important;
    border: 1px solid #FECACA !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.btn-remove-member:hover {
    background: #FEE2E2 !important;
    border-color: #DC2626 !important;
}

/* ===== LEAVE GROUP SECTION ===== */
.group-leave-section {
    text-align: center !important;
    padding: 1.5rem 0 !important;
    margin-top: 1rem !important;
    border-top: 1px solid #E2E8F0 !important;
}

.btn-danger-outline {
    font-size: 0.95rem !important;
    padding: 0.75rem 1.5rem !important;
    background: transparent !important;
    color: #DC2626 !important;
    border: 2px solid #FECACA !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.btn-danger-outline:hover {
    background: #FEF2F2 !important;
    border-color: #DC2626 !important;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center !important;
    padding: 2rem !important;
    color: #94A3B8 !important;
    font-size: 0.95rem !important;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .leaderboard-controls {
        width: 100% !important;
    }

    .leaderboard-controls select {
        flex: 1 !important;
    }

    .admin-actions {
        flex-direction: column !important;
    }

    .admin-actions .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    .member-row {
        flex-wrap: wrap !important;
    }

    .leaderboard-opt-in {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .leaderboard-opt-in input[type="text"] {
        width: 100% !important;
    }
}

/* ===== INSTRUCTIONAL COPY & TOOLTIPS ===== */

/* Section Subtitles */
.section-subtitle {
    font-size: 0.9rem !important;
    color: #64748B !important;
    margin: -0.5rem 0 1rem 0 !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
}

/* Stat Tooltips */
.stat-tooltip {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 16px !important;
    height: 16px !important;
    background: #E2E8F0 !important;
    color: #64748B !important;
    border-radius: 50% !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    margin-left: 6px !important;
    cursor: help !important;
    transition: all 0.2s ease !important;
    vertical-align: middle !important;
    position: relative !important;
}

.stat-tooltip:hover {
    background: #475569 !important;
    color: white !important;
}

/* Custom Tooltip Popup */
.stat-tooltip::after {
    content: attr(data-tooltip);
    position: absolute !important;
    bottom: calc(100% + 8px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: #1E293B !important;
    color: white !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    font-weight: 400 !important;
    white-space: nowrap !important;
    max-width: 250px !important;
    white-space: normal !important;
    text-align: center !important;
    z-index: 1000 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.2s ease, visibility 0.2s ease !important;
    pointer-events: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Tooltip Arrow */
.stat-tooltip::before {
    content: '' !important;
    position: absolute !important;
    bottom: calc(100% + 2px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border: 6px solid transparent !important;
    border-top-color: #1E293B !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.2s ease, visibility 0.2s ease !important;
    z-index: 1001 !important;
}

.stat-tooltip:hover::after,
.stat-tooltip:hover::before {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Make stat labels display inline with tooltips */
.stat-label {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
}

/* Empty State Boxes */
.empty-state-box {
    background: #F8FAFC !important;
    border: 2px dashed #E2E8F0 !important;
    border-radius: 12px !important;
    padding: 2rem !important;
    text-align: center !important;
}

.empty-state-box .empty-state-icon {
    margin-bottom: 1rem !important;
}

.empty-state-box .empty-state-icon svg {
    stroke: #94A3B8 !important;
}

.empty-state-box h3 {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #1E293B !important;
    margin-bottom: 0.5rem !important;
}

.empty-state-box p {
    font-size: 0.9rem !important;
    color: #64748B !important;
    max-width: 300px !important;
    margin: 0 auto !important;
}

/* Loading State */
.loading-state {
    color: #94A3B8 !important;
    font-style: italic !important;
}

/* Leaderboard Opt-In Improvements */
.leaderboard-opt-in {
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
    padding: 1rem 1.25rem !important;
    margin-top: 1rem !important;
}

.opt-in-toggle {
    margin-bottom: 0.5rem !important;
}

.opt-in-toggle label {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-weight: 500 !important;
    color: #1E293B !important;
    cursor: pointer !important;
}

.opt-in-toggle input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    cursor: pointer !important;
}

.opt-in-hint {
    font-size: 0.8rem !important;
    color: #64748B !important;
    margin: 0.25rem 0 0.75rem 0 !important;
    padding-left: 26px !important;
}

.display-name-input {
    width: 100% !important;
    max-width: 300px !important;
    padding: 0.5rem 0.75rem !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    background: white !important;
}

.display-name-input:focus {
    outline: none !important;
    border-color: #475569 !important;
}

/* Admin Action Items with Hints */
.admin-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
}

.admin-action-item {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
}

.action-hint {
    font-size: 0.75rem !important;
    color: #94A3B8 !important;
    padding-left: 0.25rem !important;
}

/* Invite Code Hint */
.invite-code-hint {
    font-size: 0.85rem !important;
    color: #64748B !important;
    text-align: center !important;
    margin-top: 0.75rem !important;
    line-height: 1.4 !important;
}

/* Mobile Responsive for Instructional Elements */
@media (max-width: 768px) {
    .section-subtitle {
        font-size: 0.85rem !important;
    }

    .empty-state-box {
        padding: 1.5rem 1rem !important;
    }

    .admin-action-item {
        width: 100% !important;
    }

    .admin-action-item .btn {
        width: 100% !important;
    }

    .opt-in-hint {
        padding-left: 0 !important;
    }

    .display-name-input {
        max-width: 100% !important;
    }
}