@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-dark: #0f172a;
    --box-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --input-bg: #2d3748;
    --primary-btn: #3b82f6;
    --primary-btn-hover: #2563eb;
    --success-btn: #10b981;
    --success-btn-hover: #059669;
    --link-color: #38bdf8;
    --border-light: rgba(255, 255, 255, 0.05);
    --th-bg: rgba(0, 0, 0, 0.2);
    --diagonal-bg: rgba(0, 0, 0, 0.1);
    --diagonal-stripe: rgba(255, 255, 255, 0.03);
    --tbd-color: rgba(255, 255, 255, 0.2);
    --modal-bg: rgba(15, 23, 42, 0.8);
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-text: #ef4444;
}

[data-theme="light"] {
    --bg-dark: #f0fdf4;
    /* Světle šedozelenkavé pozadí */
    --box-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --input-bg: #f8fafc;
    --primary-btn: #2563eb;
    --primary-btn-hover: #1d4ed8;
    --success-btn: #16a34a;
    --success-btn-hover: #15803d;
    --link-color: #0284c7;
    --border-light: rgba(0, 0, 0, 0.1);
    --th-bg: #e2e8f0;
    --diagonal-bg: #f1f5f9;
    --diagonal-stripe: rgba(0, 0, 0, 0.03);
    --tbd-color: rgba(0, 0, 0, 0.3);
    --modal-bg: rgba(255, 255, 255, 0.8);
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-text: #dc2626;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    background-image: radial-gradient(circle at bottom right, rgba(45, 212, 191, 0.10), var(--bg-dark) 80%);
}

body.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.login-box {
    background: var(--box-bg);
    padding: 40px 30px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-light);
}

.login-box h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
}

.login-box p.subtitle {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 30px 0;
}

.login-footer {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    text-decoration: underline;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    display: block;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
select {
    width: 100%;
    background: var(--input-bg);
    color: var(--text-main);
    padding: 14px 16px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    font-size: 15px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Inter', sans-serif;
}

input::placeholder {
    color: var(--text-muted);
}

input:focus,
select:focus {
    border-color: var(--primary-btn);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn-primary,
.btn-success {
    width: 100%;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s, transform 0.1s;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

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

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

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

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

.btn-primary:active,
.btn-success:active {
    transform: scale(0.98);
}

.dashboard-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.header-bar h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.box {
    background: var(--box-bg);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-light);
}

.box h2 {
    margin: 0 0 25px 0;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 15px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.tournament-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--input-bg);
    padding: 16px 20px;
    border-radius: 14px;
    margin-bottom: 12px;
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.2s, transform 0.2s;
    border: 1px solid var(--border-light);
}

.tournament-card:hover {
    border-color: var(--primary-btn);
    transform: translateY(-2px);
}

.tournament-card h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
}

.tournament-card p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
    align-items: center;
}

.msg-box {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    gap: 10px;
    align-items: center;
}

.msg-err {
    background-color: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-bg);
}

.msg-ok {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--success-btn);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* TABULKA */
.table-responsive {
    overflow-x: auto;
    margin-top: 10px;
}

.tournament-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--input-bg);
    border-radius: 12px;
    overflow: hidden;
    min-width: 500px;
}

.tournament-table th,
.tournament-table td {
    padding: 15px;
    text-align: center;
    border: 1px solid var(--border-light);
}

.tournament-table th {
    background: var(--th-bg);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
}

.tournament-table th.row-header {
    text-align: left;
    color: var(--text-main);
}

.diagonal-cell {
    background-color: var(--diagonal-bg);
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, var(--diagonal-stripe) 10px, var(--diagonal-stripe) 20px);
}

.clickable-cell {
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: background 0.2s;
}

.clickable-cell:hover {
    background: rgba(59, 130, 246, 0.1);
}

.cell-win {
    color: var(--success-btn);
}

.cell-loss {
    color: var(--danger-text);
}

.cell-draw {
    color: var(--text-muted);
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-bg);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--box-bg);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-light);
    text-align: center;
}

.modal-content h3 {
    margin: 0 0 20px 0;
}

.score-modal-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 30px 0;
}

.player-score-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.player-score-col label {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.player-score-col input {
    width: 80px;
    height: 60px;
    font-size: 28px;
    text-align: center;
    margin: 0;
    font-weight: bold;
    border-radius: 12px;
}

.score-colon {
    font-size: 30px;
    font-weight: bold;
    color: var(--text-muted);
    margin-top: 25px;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 15px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
}

.btn-secondary:hover {
    background: var(--input-bg);
}

/* PÓDIUM */
.podium-container {
    background: var(--box-bg);
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.podium-title {
    color: var(--text-main);
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.podium-places {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 15px;
    margin-bottom: 25px;
}

.podium-place {
    background: var(--input-bg);
    border-radius: 12px;
    padding: 15px 10px;
    width: 30%;
    max-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
}

.podium-place.first {
    border-color: gold;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    transform: translateY(-15px);
}

.podium-place.second {
    border-color: silver;
}

.podium-place.third {
    border-color: #cd7f32;
}

.podium-medal {
    font-size: 35px;
    margin-bottom: 5px;
}

.podium-name {
    font-weight: 700;
    font-size: 15px;
    word-break: break-word;
    color: var(--text-main);
}

.btn-whatsapp {
    background: #25D366;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
}

.btn-whatsapp:hover {
    background: #20bd5a;
}

/* HAMBURGER MENU */
.header-icon-btn {
    background: transparent;
    color: var(--text-main);
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    outline: none;
}

.side-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 260px;
    height: 100%;
    background-color: var(--box-bg);
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.2);
    z-index: 4000;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.side-menu.open {
    right: 0;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
    z-index: 3999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.menu-overlay.open {
    display: block;
    opacity: 1;
}

.side-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
}

.side-menu-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-main);
}

.close-menu-btn {
    background: transparent;
    color: var(--text-main);
    font-size: 30px;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 1;
}

.side-menu-item {
    background: transparent;
    color: var(--text-main);
    border: none;
    border-bottom: 1px solid var(--border-light);
    padding: 18px 20px;
    text-align: left;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
    font-weight: 500;
}

.side-menu-item i {
    width: 24px;
    text-align: center;
    font-size: 18px;
}

.side-menu-item:hover {
    background: var(--input-bg);
}