/* Custom NFL Simulator Styles */

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Enhanced Navbar Styling */
.navbar {
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
    border-bottom: 3px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.6rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
    text-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.navbar-brand i {
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    border-radius: 8px;
    margin: 0 0.25rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.navbar-nav .nav-link i {
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
}

.navbar-nav .nav-link:hover i {
    transform: scale(1.1);
}

.navbar-toggler {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.navbar-toggler:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar-toggler-icon {
    filter: brightness(1.2);
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}
.card-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 12px 12px 0 0 !important;
    padding: 1.5rem;
}

.card-header h2, .card-header h3, .card-header h4, .card-header h5 {
    color: white;
    margin-bottom: 0;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #003d82);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.form-select, .form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.form-select:focus, .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.progress {
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(135deg, #28a745, #20c997);
    transition: width 0.6s ease;
}

.badge {
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
}

.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.5rem;
}

.table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-dark {
    background: linear-gradient(135deg, #343a40, #495057);
}

/* Override Bootstrap table-dark in our dark theme */
[data-bs-theme="dark"] .table-dark {
    background: #2c3034;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: #f8f9fa;
}

/* Dark mode table improvements */
[data-bs-theme="dark"] .table {
    background: #2c3034;
    color: #ffffff;
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(even) > td {
    background-color: rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] .table th {
    background-color: #404448;
    color: #ffffff;
    border-color: #555;
}

[data-bs-theme="dark"] .table td {
    border-color: #555;
    color: #ffffff;
}

/* Enhanced Dark Mode Navbar */
[data-bs-theme="dark"] .navbar {
    background: linear-gradient(135deg, #1a1f36, #2d3561, #1e2746) !important;
    border-bottom: 3px solid rgba(64, 123, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .navbar-brand {
    color: #ffffff !important;
    text-shadow: 0 2px 8px rgba(64, 123, 255, 0.5);
    background: transparent !important;
    padding: 0.75rem 1rem;
}

[data-bs-theme="dark"] .navbar-brand:hover {
    color: #64b5f6 !important;
    text-shadow: 0 3px 12px rgba(64, 123, 255, 0.7);
}

[data-bs-theme="dark"] .navbar-brand i {
    background: linear-gradient(45deg, #64b5f6, #42a5f5, #2196f3);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-bs-theme="dark"] .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0 0.25rem;
    border-radius: 0.375rem;
}

[data-bs-theme="dark"] .navbar-nav .nav-link:hover {
    color: #ffffff !important;
    background: rgba(100, 181, 246, 0.2);
    border-color: rgba(100, 181, 246, 0.3);
    box-shadow: 0 4px 15px rgba(64, 123, 255, 0.3);
}

[data-bs-theme="dark"] .navbar-nav .nav-link.active {
    color: #ffffff !important;
    background: rgba(100, 181, 246, 0.25);
    border-color: rgba(100, 181, 246, 0.4);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(64, 123, 255, 0.4);
}

[data-bs-theme="dark"] .navbar-toggler {
    border-color: rgba(100, 181, 246, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .navbar-toggler:hover {
    background: rgba(100, 181, 246, 0.15);
    border-color: rgba(100, 181, 246, 0.6);
}

[data-bs-theme="dark"] .dropdown-menu {
    background: linear-gradient(135deg, #2d3561, #1e2746);
    border: 1px solid rgba(100, 181, 246, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .dropdown-item {
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background: rgba(100, 181, 246, 0.2);
    color: #ffffff;
}

/* Hover effects for dark mode tables */
[data-bs-theme="dark"] .table-hover tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.12);
}

.table td, .table th {
    padding: 1rem;
    vertical-align: middle;
}

/* Team comparison specific styles */
.comparison-vs {
    font-size: 2rem;
    font-weight: bold;
    color: #007bff;
}

/* Weather and game condition indicators */
.weather-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

/* Roster viewer enhancements */
.player-row:hover {
    background-color: #e3f2fd !important;
    transition: background-color 0.3s ease;
}

/* Week simulation matchup cards */
.matchup-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Position group colors */
.position-offense {
    color: #28a745;
    font-weight: 600;
}

.position-defense {
    color: #dc3545;
    font-weight: 600;
}

.position-special {
    color: #ffc107;
    font-weight: 600;
}

/* Rating progress bars */
.rating-bar {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #dc3545 0%, #ffc107 50%, #28a745 100%);
    position: relative;
}

.rating-indicator {
    position: absolute;
    top: -2px;
    width: 4px;
    height: 12px;
    background: #333;
    border-radius: 2px;
}

/* Animation for loading states */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Button loading state improvements */
.btn-loading {
    opacity: 0.8;
    cursor: not-allowed !important;
    pointer-events: none;
}

.btn-loading .spinner-border {
    animation: spin 1s linear infinite;
}

/* Page loading overlay */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;
}

.page-loading-overlay.show {
    display: flex;
}

.page-loading-content {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.page-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

/* Final Score Display Improvements */
.final-score-container {
    padding: 2rem 1rem;
}

.final-score-team {
    min-width: 0; /* Allow flex items to shrink */
    flex: 1 1 auto;
}

.final-score-team h4 {
    word-wrap: break-word;
    hyphens: auto;
    line-height: 1.2;
}

.final-score-divider {
    flex: 0 0 auto;
    margin: 0 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-header {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .comparison-vs {
        font-size: 1.5rem;
    }
    
    /* Mobile final score adjustments */
    .final-score-container {
        padding: 1rem 0.5rem;
    }
    
    .final-score-divider {
        margin: 0 1rem;
    }
    
    .final-score-team h4 {
        font-size: 1.1rem;
        min-height: 2rem !important;
    }
    
    .display-4 {
        font-size: 2.5rem !important;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0056b3, #003d82);
}

/* Enhanced form styling for weight editor */
.weight-input {
    width: 80px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.position-section {
    border-left: 4px solid #007bff;
    padding-left: 1rem;
    margin-bottom: 2rem;
    border-radius: 0 8px 8px 0;
    background: linear-gradient(90deg, rgba(0,123,255,0.05) 0%, transparent 100%);
}

.position-section.offense {
    border-left-color: #28a745;
    background: linear-gradient(90deg, rgba(40,167,69,0.05) 0%, transparent 100%);
}

.position-section.defense {
    border-left-color: #dc3545;
    background: linear-gradient(90deg, rgba(220,53,69,0.05) 0%, transparent 100%);
}

.position-section.special {
    border-left-color: #ffc107;
    background: linear-gradient(90deg, rgba(255,193,7,0.05) 0%, transparent 100%);
}

/* Weight editor main container */
.edit-weights {
    background: var(--bs-body-bg);
    min-height: 100vh;
}

/* Weight editor card improvements */
.edit-weights .card {
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.02);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    overflow: hidden;
}

.edit-weights .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0,123,255,0.15);
    border-color: rgba(0,123,255,0.3);
}

/* Authentication Modal and Blur Effects */
.blurred-background {
    filter: blur(5px);
    pointer-events: none;
    transition: filter 0.3s ease;
}

.modal.show {
    z-index: 1060;
}

.modal-content {
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    overflow: hidden;
}

.modal-header.bg-primary {
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
    border-bottom: none;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1.5rem 2rem;
}

/* Dark mode card headers with better gradients */
.edit-weights .card-header {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1rem;
    border: none;
    position: relative;
    overflow: hidden;
}

.edit-weights .card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255,255,255,0.1) 0%, 
        rgba(255,255,255,0.05) 50%, 
        rgba(0,0,0,0.1) 100%);
    pointer-events: none;
}

.edit-weights .card-header.offense {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.edit-weights .card-header.defense {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
}

.edit-weights .card-header.special {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

/* Input styling improvements */
.edit-weights .input-group {
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 8px;
    overflow: hidden;
}

.edit-weights .input-group-text {
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: none;
    background: rgba(108,117,125,0.1);
    color: var(--bs-body-color);
    min-width: 120px;
    justify-content: flex-start;
    padding-left: 12px;
}

.edit-weights .form-control {
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: right;
    background: rgba(255,255,255,0.05);
    color: var(--bs-body-color);
    max-width: 60px;
    width: 60px;
    transition: all 0.2s ease;
}

/* Weight Row Layout */
.weight-row {
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 0.75rem;
}

.weight-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 123, 255, 0.2);
}

.weight-label {
    font-size: 0.85rem;
    color: var(--bs-body-color);
    font-weight: 500;
    opacity: 0.85;
}

.weight-value {
    flex-shrink: 0;
    margin-left: 12px;
}

/* Dark mode weight row styling */
[data-bs-theme="dark"] .weight-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(100, 181, 246, 0.2);
}

[data-bs-theme="dark"] .weight-row:hover {
    background: rgba(100, 181, 246, 0.05);
    border-color: rgba(100, 181, 246, 0.3);
}

[data-bs-theme="dark"] .weight-label {
    color: rgba(255, 255, 255, 0.85);
}

.edit-weights .form-control:focus {
    background: rgba(0,123,255,0.1);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
    transform: scale(1.05);
}

/* Enhanced visual feedback */
.input-changed {
    background: rgba(255,193,7,0.2) !important;
    box-shadow: 0 0 0 2px rgba(255,193,7,0.5) !important;
    transform: scale(1.02) !important;
    transition: all 0.3s ease !important;
}

/* Total progress bars */
.edit-weights .progress {
    height: 8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.1);
    overflow: hidden;
}

.edit-weights .progress-bar {
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 4px;
    transition: all 0.5s ease;
    position: relative;
}

.edit-weights .progress-bar.bg-warning {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.edit-weights .progress-bar.bg-danger {
    background: linear-gradient(90deg, #dc3545, #e83e8c);
}

/* Total display styling */
.edit-weights .total-display {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(40,167,69,0.1), rgba(32,201,151,0.1));
    border: 2px solid rgba(40,167,69,0.3);
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

.edit-weights .total-display.warning {
    background: linear-gradient(135deg, rgba(255,193,7,0.1), rgba(253,126,20,0.1));
    border-color: rgba(255,193,7,0.5);
    color: #ffc107;
}

.edit-weights .total-display.danger {
    background: linear-gradient(135deg, rgba(220,53,69,0.1), rgba(232,62,140,0.1));
    border-color: rgba(220,53,69,0.5);
    color: #dc3545;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .edit-weights .input-group-text {
        min-width: 90px !important;
        font-size: 0.75rem;
        padding-left: 8px;
    }
    
    .edit-weights .form-control {
        max-width: 55px !important;
        font-size: 0.9rem;
    }
    
    .edit-weights .card-body {
        padding: 0.75rem !important;
    }
    
    .edit-weights .card-header {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
}

/* Force white text only on gradient blue card headers */
.card-header,
.card-header *,
.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6,
.card-header p,
.card-header small {
    color: white !important;
}

/* Do NOT apply to info sections - they should keep their current styling */
.alert-info,
.alert-info *,
.alert-info h5,
.alert-info p {
    color: inherit !important;
}