/* ===== CSS Custom Properties ===== */
:root {
    --primary: 220 100% 50%; /* #0066FF - Electric Blue */
    --secondary: 240 21% 15%; /* #1A1D29 - Deep Navy */
    --accent: 45 100% 60%; /* #FFCC00 - Bright Gold */
    --background: 210 17% 98%; /* #F8FAFC - Cool White */
    --text: 240 9% 9%; /* #16181D - Dark Blue Gray */
    --text-muted: 220 9% 46%;
    --success: 142 71% 45%;
    --warning: 45 100% 60%;
    --danger: 0 84% 60%;
    --info: 199 89% 48%;
    --light: 210 17% 95%;
    --dark: 240 21% 15%;
}

/* ===== Base Styles ===== */
body {
    font-family: 'Inter', sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--text));
    line-height: 1.6;
    font-weight: 400;
    /* Mobile optimization */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ===== Typography ===== */
.hero-title,
.display-1,
.display-2,
.display-3,
.display-4,
.display-5,
.display-6 {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    margin-bottom: 1.5rem !important;
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    margin-bottom: 2rem !important;
}





/* ===== User Mentions Styles ===== */
.mention {
    background-color: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
    padding: 2px 6px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mention:hover {
    background-color: hsl(var(--primary) / 0.2);
    color: hsl(var(--primary));
    text-decoration: none;
}

/* ===== Advertisement Styles ===== */
.ad-container {
    margin: 20px 0;
    padding: 15px;
    background-color: hsl(var(--light));
    border: 1px solid hsl(var(--light));
    border-radius: 8px;
    transition: all 0.3s ease;
}

.ad-container:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ad-label {
    color: hsl(var(--text-muted));
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.sidebar-ad {
    max-width: 300px;
    background-color: hsl(var(--background));
}

.sidebar-ad ins {
    min-height: 250px;
    display: block !important;
}

/* Responsive ad adjustments */
@media (max-width: 768px) {
    .ad-container {
        margin: 15px 0;
        padding: 10px;
    }
    
    .sidebar-ad {
        max-width: 100%;
        margin: 15px 0;
    }
}

/* Mention autocomplete dropdown */
.mention-dropdown {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    min-width: 250px;
}

.mention-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.15s ease;
}

.mention-item:hover,
.mention-item.active {
    background-color: hsl(var(--primary) / 0.05);
}

.mention-item:last-child {
    border-bottom: none;
}

.mention-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.mention-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: hsl(var(--primary));
    color: white;
    display: flex;
    align-items: center;
    justify-content-center;
    font-size: 14px;
    font-weight: 600;
}

.mention-info {
    flex: 1;
}

.mention-name {
    font-weight: 600;
    margin: 0;
    font-size: 14px;
}

.mention-username {
    color: #666;
    margin: 0;
    font-size: 12px;
}

/* ===== Push Notifications Styles ===== */
.notification-permission-banner {
    background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--secondary)) 100%);
    color: white;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1060;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast-container .toast {
    background: white;
    border-left: 4px solid hsl(var(--primary));
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    min-width: 300px;
}

.toast-container .toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-container .toast.toast-success {
    border-left-color: hsl(var(--success));
}

.toast-container .toast.toast-error {
    border-left-color: hsl(var(--danger));
}

.toast-container .toast.toast-info {
    border-left-color: hsl(var(--info));
}

.toast-body {
    padding: 1rem;
    display: flex;
    align-items: center;
}

.notification-indicator {
    position: relative;
    transition: color 0.3s ease;
}

.notification-indicator:hover {
    color: #007bff !important;
}

.notification-indicator.has-notifications {
    color: #dc3545 !important;
    animation: bellShake 0.5s ease-in-out;
}

/* Bell shake animation */
@keyframes bellShake {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-10deg); }
    20%, 40%, 60%, 80% { transform: rotate(10deg); }
}

.notification-indicator .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: hsl(var(--danger));
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

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

.notification-dropdown {
    min-width: 350px;
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid hsl(var(--light));
    transition: background-color 0.15s ease;
}

.notification-item:hover {
    background-color: hsl(var(--light));
}

.notification-item.unread {
    background-color: hsl(var(--primary) / 0.05);
    border-left: 3px solid hsl(var(--primary));
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: hsl(var(--primary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}

.notification-icon.message {
    background: hsl(var(--info));
}

.notification-icon.mention {
    background: hsl(var(--warning));
}

.notification-icon.event {
    background: hsl(var(--success));
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.notification-text {
    color: hsl(var(--text-muted));
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.notification-time {
    color: hsl(var(--text-muted));
    font-size: 0.75rem;
}

.notification-settings {
    background: white;
    border: 1px solid hsl(var(--light));
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.notification-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid hsl(var(--light));
}

.notification-toggle:last-child {
    border-bottom: none;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.toggle-switch.active {
    background: hsl(var(--primary));
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-switch.active::after {
    transform: translateX(26px);
}

/* Hover effects for clickable cards */
.hover-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.hover-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background-color: #f8f9fa;
}

/* Badge styling */
.admin-badge {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.founder-badge {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(142, 68, 173, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Navigation alignment fixes */
.navbar-nav .nav-item.dropdown .nav-link {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    line-height: 1.5 !important;
    vertical-align: baseline !important;
}

.navbar-nav .nav-link {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    line-height: 1.5 !important;
}

/* Ensure dropdown toggle aligns with other nav items */
.navbar-nav .dropdown-toggle::after {
    vertical-align: middle !important;
    margin-left: 0.5em !important;
}

.lead {
    font-weight: 400;
    font-size: 1.125rem;
}

/* ===== Custom Bootstrap Color Overrides ===== */
.btn-primary {
    background-color: hsl(var(--primary));
    border-color: hsl(var(--primary));
    color: white;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: hsl(220 100% 45%);
    border-color: hsl(220 100% 45%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.btn-outline-primary {
    color: hsl(var(--primary));
    border-color: hsl(var(--primary));
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: hsl(var(--primary));
    border-color: hsl(var(--primary));
    color: white;
}

.text-primary {
    color: hsl(var(--primary)) !important;
}

.bg-primary {
    background-color: hsl(var(--primary)) !important;
}

.border-primary {
    border-color: hsl(var(--primary)) !important;
}

.bg-dark {
    background-color: hsl(var(--secondary)) !important;
}

.text-warning {
    color: hsl(var(--accent)) !important;
}

.bg-warning {
    background-color: hsl(var(--accent)) !important;
}

/* ===== Navigation ===== */
.navbar {
    background-color: hsl(var(--secondary)) !important;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white !important;
}

.brand-text {
    font-family: 'Orbitron', monospace;
    color: hsl(var(--primary)) !important;
    font-weight: 700;
    letter-spacing: 1px;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: hsl(var(--primary)) !important;
}

/* ===== Hero Section ===== */
.hero-section {
    background: linear-gradient(135deg, hsl(var(--secondary) / 0.4), hsl(var(--primary) / 0.3)),
                url('/static/hero-banner.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26, 29, 41, 0.85), rgba(0, 102, 255, 0.6));
    z-index: 1;
}

.hero-title {
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.9);
    margin-bottom: 2rem;
    color: white !important;
    opacity: 1 !important;
}

.hero-section .text-white {
    color: white !important;
    opacity: 1 !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.hero-buttons .btn {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* ===== Event Cards ===== */
.event-card {
    transition: all 0.3s ease;
    border: 1px solid hsl(var(--light));
    border-radius: 20px;
    overflow: hidden;
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, hsl(var(--light)) 100%);
}

.event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 102, 255, 0.15) !important;
    border-color: hsl(var(--primary) / 0.3);
}

.event-image {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.event-image-placeholder {
    height: 200px;
    background: linear-gradient(135deg, hsl(var(--light)), hsl(var(--background)));
}

.event-card:hover .event-image {
    transform: scale(1.05);
}

.event-image-small {
    height: 120px;
    object-fit: cover;
}

.event-meta {
    font-size: 0.9rem;
}

.event-meta i {
    width: 16px;
    text-align: center;
}

/* ===== Stats Section ===== */
.stat-item {
    padding: 2rem 1rem;
}

.stat-item i {
    transition: transform 0.3s ease;
}

.stat-item:hover i {
    transform: scale(1.1);
}

.stat-item h3 {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    color: hsl(var(--primary));
    font-weight: 700;
}

/* ===== Form Styles ===== */
.form-control:focus,
.form-select:focus {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 0.25rem rgba(217, 46, 46, 0.15);
}

.section-header {
    border-bottom: 2px solid hsl(var(--primary));
    padding-bottom: 0.5rem;
}

/* ===== Map Styles ===== */
.map-sidebar {
    height: 600px;
}

.event-list-item {
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.event-list-item:hover {
    background-color: hsl(var(--light)) !important;
}

.event-list-item.active {
    background-color: hsl(var(--primary) / 0.1);
    border-left: 4px solid hsl(var(--primary));
}

.map-marker-legend {
    display: inline-flex;
    align-items: center;
}

.map-controls button {
    transition: all 0.2s ease;
}

.map-controls button:hover {
    transform: translateY(-1px);
}

/* ===== Event Detail Styles ===== */
.event-meta-large {
    background: hsl(var(--light));
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
}

.countdown-timer {
    border: 2px solid hsl(var(--primary));
}

.countdown-timer .card-body {
    padding: 1.5rem;
}

.detail-item {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid hsl(var(--light));
}

.detail-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.social-share a {
    transition: transform 0.2s ease;
}

.social-share a:hover {
    transform: scale(1.1);
}

/* ===== Footer ===== */
footer {
    background-color: hsl(var(--secondary)) !important;
}

.social-links a {
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: hsl(var(--primary)) !important;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .hero-section {
        background-attachment: scroll;
        min-height: 80vh;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .event-meta-large {
        padding: 1rem;
    }
    
    .stat-item {
        padding: 1rem;
        margin-bottom: 2rem;
    }
    
    .map-sidebar {
        height: 400px;
        margin-bottom: 1rem;
    }
    
    #map {
        height: 400px !important;
    }
}

@media (max-width: 576px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 1.75rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .event-card {
        margin-bottom: 1.5rem;
    }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== Custom Badges ===== */
.badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
}

.badge.bg-light {
    color: hsl(var(--text)) !important;
    background-color: hsl(var(--light)) !important;
    border: 1px solid hsl(var(--text) / 0.2);
}

/* ===== Loading States ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ===== Utility Classes ===== */
.text-racing {
    font-family: 'Orbitron', monospace !important;
    font-weight: 700;
}

.shadow-custom {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.rounded-custom {
    border-radius: 15px;
}

/* ===== Print Styles ===== */
@media print {
    .navbar,
    .hero-section,
    footer,
    .btn,
    .social-share {
        display: none !important;
    }
    
    .container {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}

/* ===== Accessibility Improvements ===== */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid hsl(var(--primary));
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: hsl(var(--primary));
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Notification Dropdown Styling */
.notification-dropdown {
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.notification-item {
    border-bottom: 1px solid #f8f9fa;
    padding: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.notification-item:hover {
    background-color: #f8f9fa;
    text-decoration: none;
    color: inherit;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 0.9rem;
}

.notification-icon.message {
    background-color: #007bff;
    color: white;
}

.notification-icon.mention {
    background-color: #28a745;
    color: white;
}

.notification-icon.like {
    background-color: #dc3545;
    color: white;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: #333;
}

.notification-text {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.notification-time {
    font-size: 0.75rem;
    color: #999;
}

/* ===== Dark Mode Support (Future Enhancement) ===== */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: hsl(var(--secondary) / 0.1);
    }
    
    .bg-light {
        background-color: hsl(var(--secondary) / 0.05) !important;
    }
}
