/* === MeinTurnierplan - Hauptstyles === */
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --success: #0d904f;
    --success-light: #e6f4ea;
    --danger: #d93025;
    --danger-light: #fce8e6;
    --warning: #f9ab00;
    --warning-light: #fef7e0;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f4;
    --gray-200: #e8eaed;
    --gray-300: #dadce0;
    --gray-400: #bdc1c6;
    --gray-500: #9aa0a6;
    --gray-600: #80868b;
    --gray-700: #5f6368;
    --gray-800: #3c4043;
    --gray-900: #202124;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.1);
    --shadow: 0 2px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Header/Nav === */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand:hover { text-decoration: none; }

.navbar-brand svg {
    width: 28px;
    height: 28px;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-links a, .navbar-links button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
}

.navbar-links a:hover {
    background: var(--gray-100);
    text-decoration: none;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

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

.btn-success {
    background: var(--success);
    color: var(--white);
}
.btn-success:hover { background: #0b7b43; color: var(--white); }

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

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gray-300);
    color: var(--gray-700);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-icon { padding: 8px; min-width: 36px; justify-content: center; }

/* === Hero === */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #4285f4 50%, #5e97f6 100%);
    color: var(--white);
    padding: 80px 24px;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero .btn {
    font-size: 1.05rem;
    padding: 14px 32px;
    background: var(--white);
    color: var(--primary);
    font-weight: 700;
}

.hero .btn:hover {
    background: var(--gray-100);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* === Container === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-sm { max-width: 800px; }

/* === Cards === */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.card:hover { box-shadow: var(--shadow-lg); }

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
}

.card-body { padding: 20px; }

/* === Tournament Cards === */
.tournament-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin: 32px 0;
}

.tournament-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: all 0.2s;
    border-left: 4px solid var(--primary);
}

.tournament-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.tournament-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.tournament-card h3 a { color: var(--gray-900); }
.tournament-card h3 a:hover { color: var(--primary); }

.tournament-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--gray-600);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.tournament-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tournament-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active { background: var(--success-light); color: var(--success); }
.badge-draft { background: var(--warning-light); color: #b06000; }
.badge-completed { background: var(--gray-100); color: var(--gray-600); }

/* === Features === */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    padding: 48px 0;
}

.feature-item {
    text-align: center;
    padding: 32px 20px;
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
}

.feature-item h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.feature-item p {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* === Forms === */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--gray-800);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.15s;
    background: var(--white);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}

select.form-control { cursor: pointer; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* === Tables === */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

table.table th {
    background: var(--gray-50);
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

table.table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

table.table tbody tr:hover { background: var(--gray-50); }

table.table .text-center { text-align: center; }
table.table .text-right { text-align: right; }

/* Standings table */
.standings-table th:first-child,
.standings-table td:first-child {
    text-align: center;
    width: 40px;
    font-weight: 700;
    color: var(--gray-600);
}

.standings-table td:nth-child(2) { font-weight: 600; }

.standings-rank-1 td:first-child,
.standings-rank-2 td:first-child {
    color: var(--success);
}

/* Match table */
.match-row { transition: background 0.1s; }
.match-row.match-live { background: var(--success-light); }
.match-row.match-finished { opacity: 0.8; }

.score-input {
    width: 50px;
    text-align: center;
    padding: 6px;
    font-size: 1rem;
    font-weight: 700;
    border: 1.5px solid var(--gray-300);
    border-radius: 4px;
}

.score-input:focus {
    border-color: var(--primary);
    outline: none;
}

.score-separator {
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0 6px;
    color: var(--gray-500);
}

.score-display {
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
}

.score-display.score-win { color: var(--success); }
.score-display.score-loss { color: var(--danger); }

/* === Tabs === */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab {
    padding: 10px 20px;
    font-weight: 500;
    color: var(--gray-600);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-size: 0.9rem;
}

.tab:hover { color: var(--primary); }
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* === Group Section === */
.group-section {
    margin-bottom: 40px;
}

.group-header {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

/* === Alerts === */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #b7e1cd; }
.alert-danger { background: var(--danger-light); color: var(--danger); border: 1px solid #f5c6c2; }
.alert-info { background: var(--primary-light); color: var(--primary); border: 1px solid #aecbfa; }
.alert-warning { background: var(--warning-light); color: #b06000; border: 1px solid #fde293; }

/* === Section === */
.section {
    padding: 40px 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
}

/* === Footer === */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 40px 24px;
    text-align: center;
    margin-top: 60px;
    font-size: 0.85rem;
}

.footer a { color: var(--gray-300); }

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 { color: var(--gray-700); margin-bottom: 8px; }

/* === Modal === */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { font-size: 1.1rem; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    padding: 4px;
}

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* === Responsive === */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.8rem; }
    .hero p { font-size: 1rem; }
    .hero { padding: 48px 16px; }
    .navbar { padding: 0 16px; }
    .tournament-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .features { grid-template-columns: 1fr; }
    .container { padding: 0 16px; }
    .navbar-links .hide-mobile { display: none; }
}

/* === Utilities === */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--gray-600); }
.text-small { font-size: 0.85rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
