@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--text-link-hover);
}

/* ==================== LOADING SCREEN ==================== */
.loading-screen, .loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    flex-direction: column;
    gap: 1rem;
}

.loading-content {
    text-align: center;
    color: var(--text-primary);
}

.loading-content h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.spinner, .spinner-ring {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== CARDS ==================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-light);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-card-alt);
    border-bottom: 1px solid var(--border-color);
}

.card-header h2, .card-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-header svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.card-content, .card-body {
    padding: 1.5rem;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-control, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-control:focus, input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder, input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--bg-gradient-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: var(--btn-danger-hover);
}

.btn-accent {
    background: var(--bg-gradient-accent);
    color: white;
}

.btn-accent:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-accent);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

/* ==================== ALERTS ==================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.alert-danger, .alert-error {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid var(--warning-border);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info-text);
    border: 1px solid var(--info-border);
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid var(--warning-border);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info-text);
    border: 1px solid var(--info-border);
}

/* ==================== TABLES ==================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--bg-table-header);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--bg-hover);
}

tr.highlight td {
    background: rgba(16, 185, 129, 0.1);
}

/* ==================== LOGIN & REGISTER ==================== */
.login-container, .register-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: radial-gradient(ellipse at top, var(--bg-card) 0%, var(--bg-dark) 100%);
}

.login-card, .register-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    border: 1px solid var(--border-color);
    animation: fadeSlideIn 0.5s ease;
}

.register-card {
    max-width: 650px;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header, .register-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1, .register-header h1 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.register-link, .login-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
}

.register-link a, .login-link a {
    color: var(--primary);
    font-weight: 600;
}

.register-link a:hover, .login-link a:hover {
    text-decoration: underline;
}

/* ==================== FORM SECTIONS ==================== */
.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.form-section h3 {
    color: var(--primary);
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.col-md-6 {
    flex: 1;
    min-width: 200px;
}

/* ==================== COLOR PICKER ==================== */
.color-picker-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.color-picker {
    width: 60px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.kit-preview {
    flex: 1;
    height: 80px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.kit-icon {
    font-size: 2.5rem;
}

/* ==================== DASHBOARD (legacy support) ==================== */
.dashboard-header {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    border: 1px solid var(--border-color);
}

.dashboard-header h1 {
    color: var(--primary);
    font-size: 2rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.dashboard-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    text-align: center;
    border: 1px solid var(--border-color);
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-light);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.dashboard-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.dashboard-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ==================== PLAYER TOOLTIP ==================== */
.player-tooltip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.player-tooltip a {
    color: var(--text-link);
    text-decoration: none;
}

.player-tooltip a:hover {
    text-decoration: underline;
}

.icon-status {
    width: 16px;
    height: 16px;
}

.team-badge, .mini-strip {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
}

/* ==================== GAME LINKS ==================== */
.game-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    background: var(--bg-card-alt);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-link);
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
}

.game-link:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

/* ==================== PAGINATION ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 1rem;
}

.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-info {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0 0.5rem;
}

/* ==================== MODALS ==================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-modal-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    backdrop-filter: blur(4px);
    padding: 1rem;
}

.modal-dialog, .modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.modal-close:hover,
.modal-close:active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.modal-close svg {
    width: 22px;
    height: 22px;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* ==================== EMPTY STATES ==================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* ==================== NOT FOUND ==================== */
.not-found {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-primary);
}

.not-found h1 {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.not-found p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* ==================== ERROR UI ==================== */
#blazor-error-ui {
    background: var(--danger);
    color: white;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-toast);
    display: none;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* ==================== MONEY VALUES ==================== */
.money-positive, .positive {
    color: var(--money-positive) !important;
}

.money-negative, .negative {
    color: var(--money-negative) !important;
}

/* ==================== UTILITY CLASSES ==================== */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-center { text-align: center; }
.text-right { text-align: right; }

.bg-card { background: var(--bg-card); }
.bg-dark { background: var(--bg-dark); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .login-card, .register-card {
        padding: 1.5rem;
    }

    .row {
        flex-direction: column;
    }

    .col-md-6 {
        min-width: 100%;
    }

    .modal-dialog, .modal {
        margin: 1rem;
        max-height: 85vh;
    }

    .btn {
        padding: 0.65rem 1.25rem;
    }

    .dashboard-header {
        flex-direction: column;
        text-align: center;
    }

    .dashboard-header h1 {
        font-size: 1.6rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .pagination {
        flex-wrap: wrap;
    }
}

/* ==================== PAGE-LEVEL DARK THEME OVERRIDES ==================== */
/* These override inline styles on pages that haven't been fully converted */

/* Player page overrides */
.player-container {
    background: var(--bg-dark);
    min-height: 100vh;
}

.player-header {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.15) 100%) !important;
    border: 1px solid var(--border-color);
}

.player-header h1 {
    color: var(--text-primary) !important;
}

.player-container .section {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color);
}

.player-container .section h2 {
    color: var(--text-primary) !important;
}

.player-container .owner-section {
    background: var(--bg-card) !important;
    border: 1px solid var(--warning) !important;
}

.player-container .my-offers-section {
    background: var(--bg-card) !important;
    border: 1px solid var(--primary) !important;
}

.player-container .contract-item {
    background: var(--bg-card-alt) !important;
}

.player-container .contract-item .label {
    color: var(--text-secondary) !important;
}

.player-container .contract-item .value {
    color: var(--text-primary) !important;
}

.player-container .stats-table thead {
    background: var(--primary) !important;
}

.player-container .stats-table td {
    border-bottom-color: var(--border-color) !important;
}

.player-container .stats-table tbody tr:hover {
    background: var(--bg-card-hover) !important;
}

.player-container .stats-table tfoot {
    background: rgba(16, 185, 129, 0.1) !important;
}

.player-container .history-item {
    background: var(--bg-card-alt) !important;
}

.player-container .history-item:hover {
    background: var(--bg-card-hover) !important;
}

.player-container .team-link-history {
    color: var(--text-primary) !important;
}

.player-container .team-link-history:hover {
    color: var(--primary) !important;
}

.player-container .offers-table thead {
    background: var(--primary) !important;
}

.player-container .offers-table td {
    border-bottom-color: var(--border-color) !important;
}

.player-container .offers-table tbody tr:hover {
    background: var(--bg-card-hover) !important;
}

.player-container .info-notice {
    background: rgba(16, 185, 129, 0.1) !important;
    color: var(--primary) !important;
    border-left-color: var(--primary) !important;
}

.player-container .empty {
    color: var(--text-muted) !important;
}

/* Competition page overrides */
.competitions-container {
    background: var(--bg-dark);
    min-height: 100vh;
    padding: 2rem;
}

.competitions-header {
    margin-bottom: 2rem;
}

.competitions-header h1 {
    color: var(--text-primary);
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.tab-btn.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.competitions-list {
    display: grid;
    gap: 1rem;
}

.competition-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
}

.competition-card:hover {
    border-color: var(--primary);
}

.competition-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.competition-title h3 {
    color: var(--text-primary);
    margin: 0.5rem 0 0;
}

.competition-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.type-league {
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
}

.type-cup {
    background: rgba(234, 179, 8, 0.15);
    color: var(--warning);
}

.type-mixed {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.level-badge {
    background: var(--bg-card-alt);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.competition-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-row {
    display: flex;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.info-label {
    color: var(--text-muted);
}

.info-value {
    color: var(--text-primary);
}

.info-value.money {
    color: var(--primary);
    font-weight: 600;
}

.prizes-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.prize-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.prize-badge.pot {
    background: rgba(234, 179, 8, 0.15);
    color: var(--warning);
}

.prize-badge.first {
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
}

.prize-badge.win {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.prize-badge.draw {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.final-position {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.position-badge {
    font-weight: 700;
}

.position-1 { color: #fbbf24; }
.position-2 { color: #9ca3af; }
.position-3 { color: #d97706; }

.winner-row {
    margin-top: 0.5rem;
}

.competition-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.no-competitions {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Modal content override */
.modal-content {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

.modal-content .modal-header {
    background: var(--bg-card-alt) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 1.25rem 1.5rem !important;
    border-radius: 16px 16px 0 0 !important;
}

.modal-content .modal-header h2,
.modal-content .modal-header h3 {
    color: var(--text-primary) !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

.modal-content .btn-close {
    background: transparent !important;
    border: none !important;
    color: var(--text-muted) !important;
    font-size: 1.5rem !important;
    cursor: pointer !important;
    padding: 0.5rem !important;
    min-width: 44px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    line-height: 1 !important;
    transition: all 0.2s !important;
}

.modal-content .btn-close:hover,
.modal-content .btn-close:active {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.modal-content .modal-body {
    color: var(--text-primary);
    padding: 1.5rem !important;
}

.modal-content .modal-body p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.modal-content .modal-footer {
    background: var(--bg-card-alt) !important;
    border-top: 1px solid var(--border-color) !important;
    padding: 1rem 1.5rem !important;
    border-radius: 0 0 16px 16px !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 0.75rem !important;
}

.modal-content .competition-details {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin: 1rem 0;
    list-style: none;
}

.modal-content .competition-details li {
    color: var(--text-secondary);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-content .competition-details li:last-child {
    border-bottom: none;
}

.modal-content .competition-details strong {
    color: var(--text-muted);
    font-weight: 500;
}

/* Modal buttons */
.modal-content .btn-secondary {
    background: var(--bg-dark) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    padding: 0.625rem 1.25rem !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

.modal-content .btn-secondary:hover:not(:disabled) {
    border-color: var(--text-muted) !important;
    color: var(--text-primary) !important;
}

.modal-content .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    border: none !important;
    color: white !important;
    padding: 0.625rem 1.25rem !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

.modal-content .btn-primary:hover:not(:disabled) {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.modal-content .btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
}

.badge-warning {
    background: rgba(234, 179, 8, 0.15);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* Team/Roster page overrides */
.team-container, .roster-container {
    background: var(--bg-dark);
    min-height: 100vh;
}

.team-header, .roster-header {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.1) 100%) !important;
    border: 1px solid var(--border-color) !important;
}

/* Staff page overrides */
.staff-container {
    background: var(--bg-dark);
    min-height: 100vh;
}

/* Match page overrides */
.match-container {
    background: var(--bg-dark);
    min-height: 100vh;
}

/* News page overrides */
.news-container {
    background: var(--bg-dark);
    min-height: 100vh;
}

/* Stadium page overrides */
.stadium-container {
    background: var(--bg-dark);
    min-height: 100vh;
}

/* Training page overrides */
.training-container {
    background: var(--bg-dark);
    min-height: 100vh;
}

/* Market pages overrides */
.player-market-container, .staff-market-container, .auction-house-container {
    background: var(--bg-dark);
    min-height: 100vh;
}

/* Admin pages overrides */
.admin-container {
    background: var(--bg-dark);
    min-height: 100vh;
}

/* Transactions page overrides */
.transactions-container {
    background: var(--bg-dark);
    min-height: 100vh;
}

/* Scouting page overrides */
.scouting-container {
    background: var(--bg-dark);
    min-height: 100vh;
}

/* Shows page overrides */
.shows-container {
    background: var(--bg-dark);
    min-height: 100vh;
}

/* ==================== GLOBAL SEARCH ==================== */
.global-search-container {
    position: relative;
    width: 200px;
    margin: 0 0.5rem;
}

.global-search-container .search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.global-search-container .search-icon {
    position: absolute;
    left: 0.6rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.global-search-container .search-input {
    width: 100%;
    padding: 0.35rem 2rem 0.35rem 1.7rem;
    background: #1e293b !important;
    border: 1px solid #334155;
    border-radius: 16px;
    color: #f8fafc !important;
    font-size: 0.8rem;
    outline: none;
    transition: all 0.15s ease;
    -webkit-text-fill-color: #f8fafc !important;
}

.global-search-container .search-input::placeholder {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
}

.global-search-container .search-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

.global-search-container .search-button {
    position: absolute;
    right: 0.2rem;
    background: var(--primary);
    border: none;
    color: white;
    font-size: 0.6rem;
    cursor: pointer;
    padding: 0.25rem 0.35rem;
    border-radius: 50%;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.global-search-container .search-button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

@media (max-width: 992px) {
    .global-search-container {
        width: 160px;
    }
}

@media (max-width: 768px) {
    .global-search-container {
        display: none;
    }
}

/* ==================== SEARCH RESULTS PAGE ==================== */
.search-results-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 60px);
}

.search-results-page .search-header {
    margin-bottom: 2rem;
}

.search-results-page .search-header h1 {
    color: var(--text-primary);
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.search-results-page .search-box {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.search-results-page .search-input-large {
    flex: 1;
    padding: 0.875rem 1.25rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.15s ease;
}

.search-results-page .search-input-large::placeholder {
    color: var(--text-muted);
}

.search-results-page .search-input-large:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-results-page .search-btn {
    padding: 0.875rem 2rem;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.search-results-page .search-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.search-results-page .search-summary {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-results-page .loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--text-muted);
}

.search-results-page .spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: searchSpin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes searchSpin {
    to { transform: rotate(360deg); }
}

.search-results-page .results-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.search-results-page .result-group {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.search-results-page .group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card-alt);
    border-bottom: 1px solid var(--border-color);
}

.search-results-page .group-icon {
    font-size: 1.5rem;
}

.search-results-page .group-header h2 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.search-results-page .group-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-results-page .group-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1px;
    background: var(--border-color);
}

.search-results-page .result-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    text-decoration: none;
    transition: all 0.15s ease;
}

.search-results-page .result-card:hover {
    background: var(--bg-card-hover);
}

.search-results-page .result-image {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.search-results-page .result-placeholder {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card-alt);
    border-radius: 50%;
    font-size: 1.25rem;
    border: 2px solid var(--border-color);
}

.search-results-page .result-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.search-results-page .result-name {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-results-page .result-subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.125rem;
}

.search-results-page .load-more-btn {
    width: 100%;
    padding: 0.875rem;
    background: transparent;
    border: none;
    border-top: 1px solid var(--border-color);
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.search-results-page .load-more-btn:hover {
    background: var(--bg-hover);
}

.search-results-page .btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: searchSpin 0.8s linear infinite;
}

.search-results-page .no-results,
.search-results-page .search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.search-results-page .no-results-icon,
.search-results-page .empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.search-results-page .no-results h2,
.search-results-page .search-empty h2 {
    color: var(--text-primary);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.search-results-page .no-results p,
.search-results-page .search-empty p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .search-results-page {
        padding: 1rem;
    }

    .search-results-page .search-box {
        flex-direction: column;
    }

    .search-results-page .search-btn {
        width: 100%;
    }

    .search-results-page .group-items {
        grid-template-columns: 1fr;
    }

    .search-results-page .result-card {
        padding: 0.875rem 1rem;
    }

    .search-results-page .result-image,
    .search-results-page .result-placeholder {
        width: 40px;
        height: 40px;
    }
}
