:root {
    --primary: #5b21b6;
    --primary-light: #7c3aed;
    --secondary: #1e293b;
    --accent: #10b981;
    --danger: #ef4444;
    --background: #0f172a;
    --surface: rgba(30, 41, 59, 0.7);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.03);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

.glass-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, #1e1b4b 0%, #0f172a 100%);
    z-index: -1;
}

.glass-background::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    animation: rotate 20s linear infinite;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    padding: 30px 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px border var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(124, 58, 237, 0.3));
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

h1 span {
    color: var(--primary-light);
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

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

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.2);
    color: white;
}

/* Section Styles */
section {
    margin-top: 40px;
    padding-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    padding-left: 15px;
}

h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--primary-light);
    border-radius: 4px;
}

/* Table Styles */
.table-container {
    background: var(--surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th {
    padding: 15px;
    text-align: center;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 18px 15px;
    text-align: center;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.text-left { text-align: left; }

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.rank-cell {
    width: 50px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 700;
    background: var(--glass);
}

tr:nth-child(1) .rank-cell { background: rgba(16, 185, 129, 0.3); color: #10b981; }
tr:nth-child(2) .rank-cell { background: rgba(16, 185, 129, 0.15); color: rgba(16, 185, 129, 0.8); }
tr:nth-child(3) .rank-cell { background: var(--glass); color: var(--text-muted); }
tr:nth-child(4) .rank-cell { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
tr:nth-child(5) .rank-cell { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.team-name {
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--text);
}

.pts-cell {
    color: var(--primary-light);
    font-weight: 800;
    font-size: 1.1rem;
}

/* Fixture Tabs */
.fixture-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none; /* Firefox */
}

.fixture-tabs::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.tab {
    padding: 8px 16px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
}

.tab.active {
    background: var(--primary);
    border-color: var(--primary-light);
    color: white;
    box-shadow: 0 4px 12px rgba(91, 33, 182, 0.4);
}

/* Fixture Layout */
.fixture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 20px;
}

@media (max-width: 600px) {
    .fixture-grid {
        grid-template-columns: 1fr;
    }
}

.match-card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.match-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.match-header {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    justify-content: space-between;
}

.match-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.match-team {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.match-team.home { text-align: right; justify-content: flex-end; }
.match-team.away { text-align: left; justify-content: flex-start; }

.team-label {
    font-weight: 700;
    font-size: 1.05rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.winner { color: var(--accent); }
.loser { color: var(--danger); }
.draw { color: #fbbf24; }

.score-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-input {
    width: 50px;
    height: 50px;
    background: rgba(15, 23, 42, 0.5);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: white;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: all 0.3s ease;
}

.score-input:focus {
    border-color: var(--primary-light);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.2);
}

.score-divider {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-muted);
}

.bye-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--secondary);
    margin: 5% auto;
    padding: 30px;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 500px;
    border-radius: 24px;
    box-shadow: var(--shadow);
    position: relative;
    animation: modalAppear 0.4s ease-out;
}

@keyframes modalAppear {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

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

.modal-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
}

.close-modal {
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
}

.add-team-form {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.add-team-form input {
    flex: 1;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 15px;
    color: white;
    outline: none;
}

.team-list-container {
    max-height: 300px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.3);
    border-radius: 16px;
    padding: 10px;
    margin-bottom: 20px;
}

.team-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 5px;
    border-radius: 10px;
}

.team-item:last-child { border-bottom: none; }

.remove-team {
    color: var(--danger);
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.2rem;
    padding: 5px;
}

.modal-content.modal-lg {
    max-width: 800px;
}

.log-table-container {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 12px;
}

.log-table th {
    background: rgba(15, 23, 42, 0.8);
    position: sticky;
    top: 0;
    font-size: 0.75rem;
}

.log-table td {
    font-size: 0.85rem;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.log-device {
    color: var(--primary-light);
    font-size: 0.75rem;
}

.modal-warning {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    padding: 15px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Chrome, Safari, Edge, Opera - Remove arrows from number input */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}
