/* tour_manager/app/static/css/style.css */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto+Condensed:wght@400;700&display=swap');

/* --- GRUNNLEGGENDE STILER (MOBILE-FIRST) --- */
html,
body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: #f1f5f9;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100%;
}

/* Added for max width on PC screens */
.centered-content {
    max-width: 1600px;
    /* Adjust as needed for desired max width */
    margin: 0 auto;
    /* Center the content */
    padding: 1rem;
    /* Add some padding around the content */
}

/* --- LOGIN SIDE (`login.html`) --- */
#background-video {
    position: fixed;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -100;
    background-size: cover;
    overflow: hidden;
    object-fit: cover;
}

#video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: -99;
}

#login-wrapper {
    position: relative;
    z-index: 1;
}

.login-card {
    background-color: rgba(30, 41, 59, 0.95);
    border: 1px solid #334155;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.login-card .card-header {
    background-color: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid #475569;
    border-radius: 12px 12px 0 0;
}

.login-card .card-header h1 {
    color: #f1f5f9;
    font-weight: 700;
}

.login-card .card-body .form-label {
    color: #cbd5e1;
    font-weight: 500;
}

/* Felles form-stiler */
.form-control {
    background-color: #334155;
    color: #f1f5f9;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    background-color: #374151;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    color: #f1f5f9;
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-check-label {
    color: #cbd5e1;
}

.form-check-input:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* --- GENERELLE KOMPONENTER (Dark Mode) --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.2;
}

/* Tables */
.table {
    color: #f1f5f9;
    background-color: rgba(30, 41, 59, 0.8);
    border-color: #334155;
}

.table thead th {
    border-bottom: 2px solid #475569;
    color: #cbd5e1;
    background-color: rgba(15, 23, 42, 0.9);
    font-weight: 600;
}

.table tbody tr {
    background-color: rgba(51, 65, 85, 0.3);
    border-top: 1px solid #334155;
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(51, 65, 85, 0.5);
}

.table tbody tr:nth-of-type(odd) {
    background-color: rgba(30, 41, 59, 0.5);
}

.table-info,
.table-info>th,
.table-info>td {
    background-color: rgba(59, 130, 246, 0.2);
    color: #bfdbfe;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: 1px solid;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fecaca;
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #bfdbfe;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fde68a;
}

/* Buttons */
.btn {
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(6, 182, 212, 0.3);
}

.btn-info:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(6, 182, 212, 0.4);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.4);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #1f2937;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
    font-weight: 600;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.4);
    color: #1f2937;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Loading state for buttons */
.btn .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Background overrides */
.bg-light {
    background-color: rgba(51, 65, 85, 0.5) !important;
    color: #f1f5f9 !important;
}

.bg-white {
    background-color: rgba(30, 41, 59, 0.8) !important;
    color: #f1f5f9 !important;
}

.bg-transparent {
    background-color: transparent !important;
}

.bg-primary {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #bfdbfe !important;
}

.bg-secondary {
    background-color: rgba(107, 114, 128, 0.2) !important;
    color: #d1d5db !important;
}

.bg-success {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #a7f3d0 !important;
}

.bg-danger {
    background-color: rgba(239, 68, 68, 0.2) !important;
    color: #fecaca !important;
}

.bg-warning {
    background-color: rgba(245, 158, 11, 0.2) !important;
    color: #fde68a !important;
}

.bg-info {
    background-color: rgba(6, 182, 212, 0.2) !important;
    color: #bfdbfe !important;
}

/* --- LAGUTTAK SPESIFIKKE STILER --- */

/* Main Layout Container */
.main-container {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* Sidebar - done dynamically with JS / or in responsive.css */
/* Main Content Area */
.main-content {
    flex: 1;
    padding: 2rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
}

/* Player List Section */
.player-list-section {
    flex: 1;
    /* Allow it to grow, but give it a max-width for balance */
    max-width: 450px;
    /* Adjust as needed */
    background: linear-gradient(180deg, #1e293b 0%, #334155 100%);
    border-right: 1px solid #475569;
    /* Moved from sidebar */
    overflow-y: auto;
    max-height: 100vh;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.2);
    order: 1;
    /* Default order, will be overridden by responsive.css */
}

/* Formation Section */
.formation-section {
    flex: 1;
    padding: 2rem;
    order: 2;
    /* Default order, will be overridden by responsive.css */
}

/* Player List Header - removed %-valgt kolonne */
.player-list-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    /* Endret fra 2fr 1fr 1fr 1fr */
    gap: 0.75rem;
    padding: 1rem 0.75rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 2px solid #334155;
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sort-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s ease;
    padding: 0.25rem;
    border-radius: 4px;
}

.sort-header:hover {
    color: #f1f5f9;
    background: rgba(59, 130, 246, 0.1);
}

.sort-header.active {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

/* Player List */
.player-list {
    max-height: 500px;
    /* Økt høyde */
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.3);
}

.player-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    /* Matcher header layout */
    gap: 0.75rem;
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid #334155;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    background: rgba(51, 65, 85, 0.1);
}

.player-item:hover {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
    padding-left: calc(0.75rem - 3px);
}

.player-item.selected {
    background: rgba(16, 185, 129, 0.2);
    border-left: 3px solid #10b981;
    padding-left: calc(0.75rem - 3px);
    color: white;
    font-weight: 500;
}

.player-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(107, 114, 128, 0.1);
}

.player-item.disabled:hover {
    background: rgba(107, 114, 128, 0.1);
    border-left: none;
    padding-left: 0.75rem;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    /* Prevent text overflow */
}

.player-position {
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 38px;
    text-align: center;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.player-position.lagkaptein {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.player-position.spurter {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.player-position.klatrer {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

.player-position.ungdom {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.player-position.tempo {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
}

.player-position.hjelperytter {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.player-position.director {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.player-details {
    flex: 1;
    min-width: 0;
    /* Prevent text overflow */
}

.player-name {
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-team {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-stat {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 500;
}

.player-price {
    font-weight: 700;
    color: #10b981;
}

.player-count-info {
    padding: 1rem;
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: center;
    border-top: 2px solid #334155;
    background: rgba(15, 23, 42, 0.5);
    font-weight: 500;
}

/* Formation Area */
.formation-area {
    background: rgba(30, 41, 59, 0.4);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(51, 65, 85, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.formation-title {
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 2rem;
    font-weight: 700;
    color: #f1f5f9;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Formation Grid - 4x4 layout som ønsket */
.formation-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    max-width: 900px;
    margin: 0 auto;
}

/* Position Slots */
.position-slot {
    height: 150px;
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border: 2px dashed rgba(156, 163, 175, 0.4);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.position-slot:hover {
    border-color: rgba(59, 130, 246, 0.6);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
}

.position-slot.filled {
    border: 2px solid #10b981;
    background: linear-gradient(135deg, #065f46 0%, #064e3b 100%);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.position-slot.filled:hover {
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.4);
}

.position-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    text-align: center;
}

.position-slot.filled .position-label {
    color: #a7f3d0;
}

/* Selected Player in Slot */
.selected-player {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.75rem;
    position: relative;
}

.player-jersey {
    width: 45px;
    height: auto;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.selected-player-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 0.25rem;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.selected-player-team {
    font-size: 0.7rem;
    color: #cbd5e1;
    margin-bottom: 0.25rem;
}

.selected-player-price {
    font-size: 0.7rem;
    color: #34d399;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.remove-player-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-player-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.6);
}

/* Direktør spanning 2 kolonner i midten */
.position-slot[data-category="Director"] {
    grid-column: 2 / 4;
    /* Spans columns 2-3 */
}

/* Team Stats */
.team-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: rgba(30, 41, 59, 0.6);
    padding: 1.75rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(51, 65, 85, 0.5);
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Transfer Info */
.transfer-info-container {
    margin-bottom: 2rem;
}

.transfer-status {
    background: rgba(30, 41, 59, 0.6);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(51, 65, 85, 0.5);
    backdrop-filter: blur(10px);
}

.transfer-status.free {
    border-left: 4px solid #10b981;
}

.transfer-status.cost {
    border-left: 4px solid #f59e0b;
}

.transfer-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.transfers-remaining {
    font-size: 1.375rem;
    font-weight: bold;
    color: #f1f5f9;
}

.transfers-label {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 500;
}

.transfer-cost {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #f59e0b;
    font-weight: 500;
}

/* Team Name Input */
.team-name-container {
    margin-bottom: 2rem;
}

.team-name-input {
    width: 100%;
    padding: 1.25rem;
    background: rgba(51, 65, 85, 0.8);
    border: 2px solid #475569;
    border-radius: 12px;
    color: #f1f5f9;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.team-name-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    background: rgba(30, 41, 59, 0.9);
}

.team-name-input::placeholder {
    color: #9ca3af;
}

.team-name-input:read-only {
    background: rgba(107, 114, 128, 0.3);
    border-color: #6b7280;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Message Container */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.message {
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.message.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9) 0%, rgba(5, 150, 105, 0.9) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

.message.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.message.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.9) 0%, rgba(217, 119, 6, 0.9) 100%);
    border-color: rgba(245, 158, 11, 0.3);
}

.message.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9) 0%, rgba(29, 78, 216, 0.9) 100%);
    border-color: rgba(59, 130, 246, 0.3);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1400px) {
    .formation-grid {
        max-width: 800px;
        gap: 1rem;
    }

    .position-slot {
        height: 140px;
    }
}

@media (max-width: 1200px) {
    .main-content {
        padding: 1.5rem;
    }

    .formation-area {
        padding: 2rem;
    }

    .formation-title {
        font-size: 1.75rem;
    }

    /* Removed sidebar specific width as it's now .player-list-section */
    .player-list-section {
        max-width: 400px;
    }
}

@media (max-width: 992px) {
    .tour-manager-container {
        flex-direction: column;
        /* Stack vertically on smaller screens */
    }

    .player-list-section {
        width: 100%;
        max-width: unset;
        /* Remove max-width on smaller screens */
        order: 1;
        /* Player list on top */
        border-right: none;
        border-bottom: 2px solid #475569;
    }

    .formation-section {
        order: 2;
        /* Formation below player list */
        padding: 1.5rem;
        /* Adjust padding for smaller screens */
    }

    .formation-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 600px;
    }

    .position-slot[data-category="Director"] {
        grid-column: 2 / 3;
        /* Single column on smaller screens */
    }

    .team-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-item {
        padding: 1.25rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .formation-area {
        padding: 1.5rem;
    }

    .formation-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .formation-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        max-width: 100%;
    }

    .position-slot {
        height: 120px;
    }

    .position-slot[data-category="Director"] {
        grid-column: 1 / -1;
        /* Full width on mobile */
    }

    .action-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .team-name-input {
        padding: 1rem;
        font-size: 1rem;
    }

    .message-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: unset;
    }

    .message {
        padding: 0.875rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .formation-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .position-slot {
        height: 100px;
    }

    .formation-title {
        font-size: 1.25rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .player-jersey {
        width: 35px;
    }

    .selected-player-name {
        font-size: 0.75rem;
    }

    .selected-player-team,
    .selected-player-price {
        font-size: 0.65rem;
    }

    .remove-player-btn {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
    }
}

/* Scrollbar Styling */
.player-list::-webkit-scrollbar,
.player-list-section::-webkit-scrollbar {
    /* Adjusted from .sidebar */
    width: 8px;
}

.player-list::-webkit-scrollbar-track,
.player-list-section::-webkit-scrollbar-track {
    /* Adjusted from .sidebar */
    background: rgba(30, 41, 59, 0.5);
    border-radius: 4px;
}

.player-list::-webkit-scrollbar-thumb,
.player-list-section::-webkit-scrollbar-thumb {
    /* Adjusted from .sidebar */
    background: linear-gradient(180deg, #475569 0%, #374151 100%);
    border-radius: 4px;
    border: 1px solid rgba(71, 85, 105, 0.3);
}

.player-list::-webkit-scrollbar-thumb:hover,
.player-list-section::-webkit-scrollbar-thumb:hover {
    /* Adjusted from .sidebar */
    background: linear-gradient(180deg, #6b7280 0%, #4b5563 100%);
}

/* Accessibility Improvements */
.position-slot:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.player-item:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.pill-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .position-slot {
        border-width: 3px;
    }

    .player-item.selected {
        border-width: 3px;
        border-color: #10b981;
    }

    .btn-primary {
        border: 2px solid #1e40af;
    }

    .message {
        border-width: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {

    .player-list-section,
    /* Adjusted from .sidebar */
    .action-buttons,
    .message-container {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 1rem !important;
    }

    .formation-area {
        break-inside: avoid;
        box-shadow: none;
        border: 2px solid #333;
    }

    .position-slot {
        box-shadow: none;
        border: 1px solid #333;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .formation-title,
    .stat-value,
    .selected-player-name {
        color: black !important;
    }
}

/* Focus Visible Support */
.btn:focus-visible,
.form-control:focus-visible,
.player-list-section .filter-select:focus-visible,
/* Adjusted from .sidebar-item */
.pill-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Dark Mode Media Query Support */
@media (prefers-color-scheme: dark) {
    /* Our styles are already dark, but we can add any specific overrides here */
}

/* Enhanced Button States */
.btn:active {
    transform: translateY(1px);
}

.btn:disabled:active {
    transform: none;
}

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

.loading * {
    cursor: wait !important;
}

/* Better form control styling */
.form-control:invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-control:valid {
    border-color: #10b981;
}

/* Sticky Elements */
.sticky-top {
    background-color: rgba(30, 41, 59, 0.95);
    border-bottom: 1px solid #334155;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    z-index: 1020;
}

/* Enhanced Card Styles */
.card {
    background-color: rgba(30, 41, 59, 0.8);
    border: 1px solid #334155;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.card-header {
    background-color: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid #475569;
    border-radius: 12px 12px 0 0;
}

.card-body {
    color: #f1f5f9;
}

/* Modal Enhancements */
.modal-content {
    background-color: rgba(30, 41, 59, 0.95) !important;
    border: 1px solid #334155;
    border-radius: 12px;
    backdrop-filter: blur(15px);
}

.modal-header {
    border-bottom: 1px solid #334155;
}

.modal-footer {
    border-top: 1px solid #334155;
}

.modal-body,
.modal-header,
.modal-footer {
    color: #f1f5f9;
}

/* Enhanced List Group */
.list-group-item {
    background-color: rgba(30, 41, 59, 0.8);
    color: #f1f5f9;
    border: 1px solid #334155;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background-color: rgba(51, 65, 85, 0.8);
}

/* Badge Enhancements */
.badge {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
}

.badge-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.badge-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.badge-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.badge-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.badge-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.badge-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

/* Progress Bar Enhancements */
.progress {
    background-color: rgba(51, 65, 85, 0.5);
    border-radius: 8px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    transition: width 0.3s ease;
}

/* Tooltip Enhancements */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    background-color: rgba(15, 23, 42, 0.95);
    border: 1px solid #334155;
    border-radius: 6px;
    backdrop-filter: blur(10px);
}

/* Dropdown Enhancements */
.dropdown-menu {
    background-color: rgba(30, 41, 59, 0.95);
    border: 1px solid #334155;
    border-radius: 8px;
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.dropdown-item {
    color: #f1f5f9;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(59, 130, 246, 0.2);
    color: #f1f5f9;
}

/* Navigation Enhancements */
.navbar {
    background-color: rgba(30, 41, 59, 0.95) !important;
    backdrop-filter: blur(15px);
    border-bottom: 1px solid #334155;
}

.navbar-brand,
.nav-link {
    color: #f1f5f9 !important;
}

.nav-link:hover {
    color: #3b82f6 !important;
}

/* Tab Enhancements */
.nav-tabs {
    border-bottom: 2px solid #334155;
}

.nav-tabs .nav-link {
    background-color: transparent;
    border: none;
    color: #94a3b8;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    border: none;
    color: #f1f5f9;
}

.nav-tabs .nav-link.active {
    background-color: transparent;
    border: none;
    border-bottom: 2px solid #3b82f6;
    color: #3b82f6;
}

/* Accordion Enhancements */
.accordion-item {
    background-color: rgba(30, 41, 59, 0.8);
    border: 1px solid #334155;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    overflow: hidden;
}

.accordion-header {
    background-color: rgba(15, 23, 42, 0.9);
}

.accordion-button {
    background-color: transparent;
    color: #f1f5f9;
    border: none;
    padding: 1rem;
    transition: all 0.2s ease;
}

.accordion-button:hover {
    background-color: rgba(51, 65, 85, 0.5);
}

.accordion-button:not(.collapsed) {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.accordion-body {
    background-color: rgba(51, 65, 85, 0.3);
    color: #f1f5f9;
}

/* Pagination Enhancements */
.pagination .page-link {
    background-color: rgba(30, 41, 59, 0.8);
    border: 1px solid #334155;
    color: #f1f5f9;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

.pagination .page-link:hover {
    background-color: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #f1f5f9;
}

.pagination .page-item.active .page-link {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.pagination .page-item.disabled .page-link {
    background-color: rgba(51, 65, 85, 0.3);
    border-color: #4b5563;
    color: #6b7280;
}

/* Breadcrumb Enhancements */
.breadcrumb {
    background-color: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.breadcrumb-item {
    color: #94a3b8;
}

.breadcrumb-item.active {
    color: #f1f5f9;
}

.breadcrumb-item+.breadcrumb-item::before {
    color: #6b7280;
}

/* Spinner/Loading Enhancements */
.spinner-border {
    border-color: rgba(59, 130, 246, 0.3);
    border-top-color: #3b82f6;
}

.spinner-grow {
    background-color: #3b82f6;
}