/* ===================== FANTAROI OPTIMIZED BUNDLE CSS ===================== */
/* Critical styles for fast initial render - Combined and optimized */

/* Competition Type Gradient Backgrounds - Enhanced visibility */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}

.bg-gradient-info {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%) !important;
    color: white !important;
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%) !important;
    color: white !important;
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #fdcb6e 0%, #f39c12 100%) !important;
    color: white !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, #55efc4 0%, #00b894 100%) !important;
    color: white !important;
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, #636e72 0%, #2d3436 100%) !important;
    color: white !important;
}

/* Ensure text visibility on gradient backgrounds */
.bg-gradient-primary .card-subtitle,
.bg-gradient-info .card-subtitle,
.bg-gradient-danger .card-subtitle,
.bg-gradient-warning .card-subtitle,
.bg-gradient-success .card-subtitle,
.bg-gradient-secondary .card-subtitle {
    color: rgba(255, 255, 255, 0.8) !important;
}

.bg-gradient-primary .card-title,
.bg-gradient-info .card-title,
.bg-gradient-danger .card-title,
.bg-gradient-warning .card-title,
.bg-gradient-success .card-title,
.bg-gradient-secondary .card-title {
    color: white !important;
    font-weight: 600 !important;
}

/* Performance optimizations first */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-display: swap;
    text-rendering: optimizeLegibility;
    font-synthesis: none;
}

/* Critical layout optimizations */
.container {
    max-width: 1200px;
    contain: layout;
}

.card, .modal, .navbar {
    contain: layout style;
}

/* GPU acceleration for better performance */
.btn, .card, .navbar-brand {
    transform: translateZ(0);
    will-change: transform;
}

/* Critical above-the-fold navbar styles */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Lazy loading and image optimization */
img {
    loading: lazy;
    decoding: async;
    height: auto;
    max-width: 100%;
}

.lazy-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* WebP support detection */
.no-webp .webp-image { display: none; }
.webp .fallback-image { display: none; }

/* Quick Action Buttons - Uniform dimensions and optimized content */
.quick-action-btn {
    height: 140px !important;
    min-height: 140px !important;
    max-height: 140px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0.75rem 0.5rem !important;
    text-align: center !important;
}

.quick-action-btn i {
    font-size: 1.5rem !important;
    margin-bottom: 0.5rem !important;
    flex-shrink: 0 !important;
}

.quick-action-btn span {
    font-size: 0.875rem !important;
    line-height: 1.2 !important;
    margin: 0.25rem 0 !important;
    flex-shrink: 0 !important;
}

.quick-action-btn small {
    font-size: 0.75rem !important;
    line-height: 1.1 !important;
    margin-top: 0.25rem !important;
    flex-shrink: 0 !important;
}

/* Enhanced Competition Dropdown Menu Styling */
.competition-dropdown-menu {
    min-width: 200px !important;
    padding: 0.75rem 0 !important;
    margin: 0.25rem 0 0 !important;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 1px solid rgba(99, 102, 241, 0.1) !important;
    border-radius: 12px !important;
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.1),
        0 4px 10px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    display: none !important; /* Hidden by default */
    z-index: 9999 !important; /* Extremely high z-index */
    position: absolute !important;
}

.competition-dropdown-menu.show {
    display: block !important; /* Show when active */
    z-index: 9999 !important;
}

.competition-dropdown-menu .dropdown-item {
    padding: 0.75rem 1.25rem !important;
    margin: 0.125rem 0.5rem !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    transition: all 0.15s ease !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    position: relative !important;
    overflow: hidden !important;
}

.competition-dropdown-menu .dropdown-item:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(129, 140, 248, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: -1;
}

.competition-dropdown-menu .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(129, 140, 248, 0.04) 100%) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
    transform: translateX(2px) !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15) !important;
}

.competition-dropdown-menu .dropdown-item:hover:before {
    opacity: 1;
}

.competition-dropdown-menu .dropdown-item i {
    width: 18px !important;
    text-align: center !important;
    margin-right: 0.75rem !important;
    font-size: 0.875rem !important;
}

.competition-dropdown-menu .dropdown-item.text-danger:hover {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.08) 0%, rgba(239, 68, 68, 0.04) 100%) !important;
    border-color: rgba(220, 38, 38, 0.2) !important;
    color: #dc2626 !important;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15) !important;
}

.competition-dropdown-menu .dropdown-divider {
    margin: 0.5rem 0.75rem !important;
    border-color: rgba(99, 102, 241, 0.1) !important;
    position: relative !important;
}

.competition-dropdown-menu .dropdown-divider:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(99, 102, 241, 0.3) 50%, transparent 100%);
}

/* Enhanced dropdown toggle button */
.dropdown-toggle-split {
    transition: all 0.15s ease !important;
    border-left: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.dropdown-toggle-split:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(129, 140, 248, 0.05) 100%) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
    transform: scale(1.05) !important;
}

/* Financial cards optimization - Critical fixes */
.financial-card .card-title {
    font-size: 0.9375rem !important;
    white-space: normal !important;
    overflow: visible !important;
    word-wrap: break-word !important;
    line-height: 1.0 !important;
    max-width: 100% !important;
}

.financial-card .card-title.text-extra-long {
    font-size: 0.75rem !important;
}

.financial-card .d-flex > div:first-child {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 45px) !important;
    margin-right: 0.25rem !important;
    overflow: visible !important;
}

/* Cookie consent critical styles */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-top: 3px solid #6f42c1;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    contain: layout style;
}

.cookie-consent-banner.show {
    transform: translateY(0);
}

/* Optimized animations with will-change */
@media (prefers-reduced-motion: no-preference) {
    .btn:hover, .card:hover {
        transform: translateZ(0) scale(1.02);
        will-change: transform;
    }
    
    .btn:active {
        transform: translateZ(0) scale(0.98);
    }
}

/* Critical responsive optimizations */
@media (max-width: 768px) {
    .financial-card .card-title {
        font-size: 0.8125rem !important;
    }
    
    .cookie-consent-content {
        flex-direction: column;
        padding: 1rem;
    }
}

/* Performance: Reduce repaints */
.table {
    contain: layout;
}

/* Critical theme variables */
:root {
    --bg-primary: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%);
    --text-primary: #1a202c;
    --border-color: rgba(0, 0, 0, 0.1);
}