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

:root {
    --primary-color: #1e3a8a;
    --secondary-color: #60a5fa;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

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

/* Header */
.header {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Search Section */
.search-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

/* Explorer UI */
.explorer-section {
    margin-top: 20px;
}

.explorer-section h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 1.2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.explorer-step {
    animation: fadeIn 0.3s ease-in-out;
}

.explorer-step.hidden {
    display: none;
}

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

.back-btn {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 5px 10px;
}

.back-btn:hover {
    text-decoration: underline;
    color: var(--primary-color);
}

.custom-select-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.explorer-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
}

.filter-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}

.grid-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 160px; /* Slights Taller */
}

.grid-card img {
    width: 60px; /* Bigger Icons */
    height: 60px;
    object-fit: contain;
    margin-bottom: 12px;
}

.grid-card span {
    font-size: 1.1rem; /* Bigger Text */
    font-weight: 600;
    line-height: 1.3;
}

/* Fixtures Grid */
.fixtures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.fixture-card {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s;
    border: 1px solid var(--border-color);
}

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

.fixture-header {
    background-color: #f1f5f9;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.fixture-status {
    font-weight: bold;
    color: var(--secondary-color);
    text-transform: capitalize;
}

.fixture-status.live { color: var(--danger-color); }
.fixture-status.finished { color: var(--text-color); opacity: 0.7; }
.fixture-status.upcoming { color: var(--success-color); }

.fixture-teams {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.team-logo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.team-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.vs {
    font-weight: bold;
    color: #9ca3af;
    margin: 0 10px;
}

.score {
    font-size: 1.5rem;
    color: var(--text-color);
}

.fixture-details {
    padding: 15px;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.detail-label {
    color: #6b7280;
}

.detail-value {
    font-weight: 500;
}

.calendar-buttons button {
    font-size: 0.8rem;
    padding: 5px 10px;
}

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

.loading, .empty-state {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    grid-column: 1 / -1;
}

/* Auth & Modal */
.auth-controls {
    position: absolute;
    top: 20px;
    right: 20px;
}

.auth-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid white;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
}

.auth-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.fav-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #ccc;
    transition: all 0.2s;
    margin-left: 5px;
}

.fav-btn.active {
    color: gold;
    text-shadow: 0 0 2px rgba(0,0,0,0.3);
}

/* Favorites Container */
.team-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 60px;
    align-items: center;
    padding: 10px;
}

.team-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.2s;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-circle:hover {
    transform: scale(1.1);
}

.team-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2px;
}

.placeholder-text {
    font-style: italic;
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 { font-size: 2rem; }
    .search-box { grid-template-columns: 1fr; }
    .fixtures-grid { grid-template-columns: 1fr; }
    .fixture-teams { flex-direction: column; gap: 15px; }
}

button.hidden { display: none !important; }
div.hidden { display: none !important; }

/* Fixtures Table */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f1f5f9;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.selection-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

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

.btn-primary-lg {
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    padding: 10px 20px;
    font-size: 1rem;
    box-shadow: var(--shadow);
}

.btn-primary-lg:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary-lg:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.fixtures-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.fixtures-table th,
.fixtures-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.fixtures-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--text-color);
}

.fixtures-table tr:hover {
    background-color: #f1f5f9;
}

.fixtures-table .checkbox-col {
    width: 40px;
    text-align: center;
}

.fixtures-table .time-col {
    font-family: monospace;
    font-weight: 600;
}

.fixtures-table .team-col {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fixtures-table .team-col img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.fixtures-table .vs-col, .fixtures-table .score-col {
    text-align: center;
    font-weight: bold;
    color: #9ca3af;
}

.fixtures-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Favorite Stars in Table */
.fav-star {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #cbd5e1; /* Gray by default */
    padding: 0 5px;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
}

.fav-star:hover {
    transform: scale(1.2);
    color: var(--warning-color);
}

.fav-star.active {
    color: var(--warning-color); /* Gold/Yellow */
}
