/* FußballManager - Main Styles */

:root {
    --primary-color: #1e40af;
    --secondary-color: #0f766e;
    --success-color: #16a34a;
    --danger-color: #dc2626;
    --info-color: #0284c7;
    --warning-color: #ea580c;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #475569;
    --spacing-unit: 0.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

/* Header */
.header {
    text-align: center;
    padding: 2rem 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #1e40af, #0f766e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header .subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Navigation */
.nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
}

.nav-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.nav-btn:hover {
    color: var(--text-primary);
}

.nav-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Content */
.content {
    padding: 1rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Grid Layouts */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.squad-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.info-grid > div {
    padding: 0.75rem;
    background: var(--surface-light);
    border-radius: 0.25rem;
}

.info-grid .label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.info-grid .value {
    display: block;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1e3a8a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #15803d;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #0369a1;
}

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

/* Tables */
.player-table, .standings-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    overflow: hidden;
}

.player-table {
    min-width: 1550px;
}

.player-list {
    overflow-x: auto;
}

.player-table thead, .standings-table thead {
    background: var(--surface-light);
}

.player-table th, .standings-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.player-table td, .standings-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.player-table tbody tr:hover, .standings-table tbody tr:hover {
    background: var(--surface-light);
}

/* Formation Editor */
.field-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(15, 118, 110, 0.1);
    border: 2px dashed var(--secondary-color);
    border-radius: 0.5rem;
    min-height: 300px;
    align-content: center;
}

.field-player {
    padding: 1rem;
    background: var(--primary-color);
    border-radius: 0.25rem;
    text-align: center;
    font-size: 0.85rem;
    cursor: grab;
    transition: all 0.2s ease;
}

.field-player:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.4);
}

/* Results List */
.results-list, .match-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-item, .match-item {
    padding: 0.75rem;
    background: var(--surface-light);
    border-radius: 0.25rem;
    border-left: 3px solid var(--primary-color);
}

.result-item.win {
    border-left-color: var(--success-color);
}

.result-item.draw {
    border-left-color: var(--warning-color);
}

.result-item.loss {
    border-left-color: var(--danger-color);
}

.empty {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem;
}

.lineup-status {
    margin: 0.5rem 0 1rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.9rem;
}

.lineup-status.ok {
    background: rgba(22, 163, 74, 0.15);
    border: 1px solid rgba(22, 163, 74, 0.4);
    color: #86efac;
}

.lineup-status.warn {
    background: rgba(234, 88, 12, 0.15);
    border: 1px solid rgba(234, 88, 12, 0.4);
    color: #fdba74;
}

.lineup-pos,
.lineup-role {
    width: 100%;
    min-width: 80px;
    padding: 0.2rem;
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
}

.lineup-tactical-role,
.team-tactic-control {
    width: 100%;
    min-width: 90px;
    padding: 0.2rem;
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
}

.tactics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.tactics-grid label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.player-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 0.75rem;
}

.detail-card {
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    border-radius: 0.35rem;
    padding: 0.6rem;
}

.detail-card strong {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface);
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Match Report */
.match-report {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.match-score {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    padding: 1rem;
    background: var(--surface-light);
    border-radius: 0.25rem;
}

.match-events {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.event {
    padding: 0.5rem;
    background: var(--surface-light);
    border-left: 3px solid var(--info-color);
    border-radius: 0.25rem;
    font-size: 0.9rem;
}

.event.goal {
    border-left-color: var(--success-color);
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.75rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .squad-container {
        grid-template-columns: 1fr;
    }

    .player-table, .standings-table {
        font-size: 0.85rem;
    }

    .player-table th, .player-table td,
    .standings-table th, .standings-table td {
        padding: 0.5rem;
    }

    .field-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav {
        flex-direction: column;
    }

    .nav-btn {
        width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page.active {
    animation: fadeIn 0.3s ease;
}

/* Settings */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 400px;
}

.setting-group {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--surface-light);
    border-radius: 0.25rem;
}

.setting-group input[type="checkbox"] {
    margin-right: 1rem;
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}

.setting-group label {
    cursor: pointer;
    flex: 1;
}
