:root {
    --bg-color: #f4f4f9;
    --card-bg: #ffffff;
    --text-color: #333;
    --accent-color: #3498db;
    --border-radius: 8px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
}

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

header {
    margin-bottom: 30px;
    text-align: center;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background: #e0e0e0;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.tab-btn.active {
    background: var(--accent-color);
    color: white;
}

.tab-content {
    display: none;
}

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

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

button {
    padding: 10px 20px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
}

button:hover {
    opacity: 0.9;
}

input[type="date"],
select {
    padding: 10px;
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    font-size: 16px;
}

/* Match Card */
.matches-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.match-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #e0e0e0;
}

.match-card.live {
    border-left: 5px solid #4caf50;
    /* Green highlight */
    background-color: #f1f8e9;
    /* Very light green bg */
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.3);
}

.danger-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
    width: 100%;
}

.danger-btn:hover {
    background-color: #c82333;
}

.live-badge {
    background-color: #f44336;
    /* Red for 'LIVE' badge */
    color: white;
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    margin-right: 5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

/* Status & League (Left) */
.meta {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-league {
    font-size: 0.8em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.league-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.meta-time {
    font-size: 1.1em;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
}

/* Teams (Center) */
.teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-size: 1.1em;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 120px;
    text-align: center;
}

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

.team-name {
    font-weight: 600;
    font-size: 0.9em;
    line-height: 1.2;
}

.vs {
    font-weight: bold;
    color: #ccc;
    font-size: 0.8em;
    margin-top: -15px;
    /* Visual adjustment to align with logos */
}

/* Tags (Right) */
.tag-preview {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.tag {
    background: #f1f3f5;
    color: #495057;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.75em;
    font-weight: 500;
    border: 1px solid transparent;
}

/* League Header */
.league-header {
    grid-column: 1 / -1;
    background: #e9ecef;
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 700;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 10px;
}

.league-header img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Match Card - Versus Style */
.matches-list {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.match-card {
    position: relative;
    height: 200px;
    border-radius: 20px;
    overflow: hidden;
    background-color: #222;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.match-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* Diagonal Background Layers */
.card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.card-bg::before,
.card-bg::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
}

/* Left side color */
.card-bg::before {
    left: 0;
    background: var(--home-color, #333);
    clip-path: polygon(0 0, 60% 0, 40% 100%, 0% 100%);
}

/* Right side color */
.card-bg::after {
    right: 0;
    background: var(--away-color, #111);
    z-index: -1;
}

/* Content Layer */
.card-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
}

/* Header: Time Pill */
.card-header {
    display: flex;
    justify-content: flex-start;
}

.time-pill {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    padding: 6px 14px;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.live-badge {
    background: #ff3b30;
    color: white;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 800;
    margin-right: 4px;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.5;
    }
}

/* Logos Container */
.logos-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-grow: 1;
    margin: 10px 0;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.4));
}

.team-logo-lg {
    width: 70px;
    height: 70px;
    object-fit: contain;
    transition: transform 0.3s;
}

.match-card:hover .team-logo-lg {
    transform: scale(1.1);
}

.vs-text {
    font-weight: 900;
    font-style: italic;
    font-size: 1.5em;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Footer: Match Info */
.card-footer {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    margin: -15px;
    /* Bleed to edges */
    margin-top: auto;
    padding: 12px 15px;
    color: white;
}

.match-title {
    font-weight: 700;
    font-size: 1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.league-info {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 6px;
}

.league-icon-sm {
    width: 16px;
    height: 16px;
    object-fit: contain;
    filter: grayscale(1);
}

/* Tags in footer (pills) */
.footer-tags {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

.mini-tag {
    background: rgba(255, 255, 255, 0.15);
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.mini-tag.active {
    background: #4caf50;
    box-shadow: 0 0 5px #4caf50;
}

/* Forms */
.card {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    max-width: 600px;
    margin: 0 auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    box-sizing: border-box;
}

.status-box {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    white-space: pre-wrap;
    display: none;
}

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

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 900px;
    border-radius: var(--border-radius);
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-body {
    display: flex;
    gap: 20px;
}

.column {
    flex: 1;
}

pre {
    background: #f8f8f8;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.85em;
}

.status-msg {
    text-align: center;
    color: #666;
    margin-bottom: 15px;
}

.playlist-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 4px;
}

.playlist-item {
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
}

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

.playlist-link {
    text-decoration: none;
    color: #2e7d32;
    font-weight: 500;
    display: block;
}

.playlist-link:hover {
    text-decoration: underline;
}

.placeholder-text {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.tag-list li {
    cursor: pointer;
    transition: background 0.2s;
}

.tag-list li:hover {
    background-color: #f0f0f0;
}

.tag-list li.selected {
    background-color: #e3f2fd;
    border: 1px solid #2196f3;
}