/* Custom overrides for Bootstrap 5 + Bootswatch Flatly theme */

/* Sticky Navbar */
.navbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* Ensure all navbar elements use Inter font */
.navbar * {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

.navbar-brand,
.navbar-nav .nav-link,
.navbar-nav .dropdown-toggle,
.navbar-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* Add padding to body to account for fixed navbar */
body {
    padding-top: 80px;
}

/* Override for mobile - ensure content clears navbar */
@media (max-width: 768px) {
    body {
        padding-top: 200px !important;
        width: 100vw !important;
        overflow-x: hidden !important;
        -webkit-text-size-adjust: 100% !important;
        -ms-text-size-adjust: 100% !important;
    }
    
    .main-content-area,
    .modern-chat-container,
    .chat-header {
        margin-top: 30px !important;
        padding-top: 0 !important;
    }
    
    .chat-title {
        margin-top: 100px !important;
        padding-top: 60px !important;
    }
    
    /* Very specific override for the Atlas title */
    .chat-header .chat-title,
    body .chat-header .chat-title {
        margin-top: 100px !important;
        padding-top: 60px !important;
    }
    
    /* Override any other mobile container padding */
    .modern-chat-container {
        padding-top: 0 !important;
    }
    
    /* Override inline styles from view files */
    body .modern-chat-container,
    body .main-content-area,
    body .chat-header {
        padding-top: 0 !important;
    }
    
    /* Prevent elements from causing horizontal scroll/zoom */
    * {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure all containers fit within viewport */
    .container,
    .container-fluid,
    .row,
    .col,
    .main-content-area,
    .modern-chat-container {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    /* Prevent specific elements from overflowing */
    table, img, video, canvas, iframe, pre, code {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* Card hover effects for plan options */
.plan-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

/* Table styling with white headers and black data cells */
.table th {
    color: #ffffff !important;
    vertical-align: middle !important;
    font-size: 0.875rem !important; /* Make table text smaller */
}

.table td,
.table .text-dark {
    color: #000000 !important;
    vertical-align: middle !important;
    font-size: 0.875rem !important; /* Make table text smaller */
}

/* Override any Bootstrap text color classes in tables */
.table .text-muted {
    color: #000000 !important;
}

/* Ensure team logos display properly */
.team-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Custom badge sizing */
.badge.fs-6 {
    font-size: 0.875rem !important;
}

/* Blur effect for premium content */
.blur-content {
    filter: blur(4px);
    pointer-events: none;
    user-select: none;
}

/* Responsive table improvements */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .team-logo {
        width: 16px;
        height: 16px;
    }
}

/* Two-column historical table format */
.results-content .table-responsive table[style*="width: 60%"] {
    width: 100% !important;
    table-layout: fixed;
}

.results-content .table-responsive table[style*="width: 60%"] th:first-child,
.results-content .table-responsive table[style*="width: 60%"] td:first-child {
    width: 60% !important;
    word-wrap: break-word;
}

.results-content .table-responsive table[style*="width: 60%"] th:last-child,
.results-content .table-responsive table[style*="width: 60%"] td:last-child {
    width: 40% !important;
    text-align: right !important;
}

/* Enhanced Sports Dropdown Styling */
.dropdown-menu {
    min-width: 280px;
    padding: 0.5rem 0;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-header {
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem 1rem 0.5rem 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #000000 !important;
    transform: translateX(4px);
}

.dropdown-item.active {
    background-color: #e3f2fd;
    color: #1976d2 !important;
    border-left: 3px solid #1976d2;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: rgba(0, 0, 0, 0.1);
}

/* Make sample question boxes the same height */
.query-card {
    height: 100%;
    display: flex;
    align-items: center;
}

.query-card .card-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

/* Global Navigation Logo Fix */
.navbar-brand img {
    height: 80px !important;
    max-width: 200px;
    object-fit: contain;
}

/* Mobile Navigation Logo Fix */
@media (max-width: 768px) {
    .navbar-brand {
        margin-left: 20px !important;
        height: auto !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .navbar-brand img {
        height: 85px !important;
        max-width: 200px;
        object-fit: contain;
    }
    
    .navbar {
        height: 95px !important;
        padding: 0.5rem 1rem;
        display: flex !important;
        align-items: center !important;
    }
    
    .navbar .container {
        display: flex !important;
        align-items: center !important;
        height: 100% !important;
    }
    
    body {
        padding-top: 200px !important;
    }
}

/* Mobile Navigation Menu Styling */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: white !important;
        border-radius: 0.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        margin-top: 0.5rem;
        padding: 1rem;
        position: absolute;
        right: 0;
        left: auto;
        top: 100%;
        width: 280px;
        z-index: 1040;
    }
    
    .navbar-nav .nav-link {
        color: #333333 !important;
        font-weight: 500;
        padding: 0.75rem 1rem;
        border-radius: 0.375rem;
        margin-bottom: 0.25rem;
    }
    
    .navbar-nav .nav-link:hover {
        background-color: #f8f9fa;
        color: #0d6efd !important;
    }
    
    .navbar-nav .nav-link.active {
        background-color: #e3f2fd;
        color: #0d6efd !important;
        font-weight: 600;
    }
    
    .dropdown-menu {
        position: static !important;
        float: none !important;
        width: 100% !important;
        margin-top: 0.5rem !important;
        background-color: #f8f9fa !important;
        border: none !important;
        box-shadow: none !important;
    }
    
    .dropdown-item {
        color: #333333 !important;
        padding: 0.5rem 1rem;
    }
    
    .dropdown-item:hover {
        background-color: #e9ecef !important;
        color: #0d6efd !important;
    }
}

/* Mobile responsiveness for historical tables */
@media (max-width: 768px) {
    /* Keep two-column historical tables in proper table format on mobile */
    .results-content .table-responsive table[style*="width: 60%"] {
        width: 100% !important;
        font-size: 0.9rem;
    }
    
    .results-content .table-responsive table[style*="width: 60%"] th,
    .results-content .table-responsive table[style*="width: 60%"] td {
        padding: 0.75rem 0.5rem !important;
    }
    
    .results-content .table-responsive table[style*="width: 60%"] th:first-child,
    .results-content .table-responsive table[style*="width: 60%"] td:first-child {
        width: 65% !important;
    }
    
    .results-content .table-responsive table[style*="width: 60%"] th:last-child,
    .results-content .table-responsive table[style*="width: 60%"] td:last-child {
        width: 35% !important;
        text-align: right !important;
    }
}