:root {
    --bg-color: #0b0f19;
    --card-bg: #161e31;
    --card-border: rgba(255, 255, 255, 0.06);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-primary: #38bdf8;
    --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #0369a1 100%);
    --live-color: #22c55e;
    --planned-color: #6366f1;
    --paused-color: #f59e0b;
    --completed-color: #64748b;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, sans-serif;
    min-height: 100vh;
    padding-bottom: 4rem;
}

h1, h2, h3, .title {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main) !important;
}

/* Navbar Styling */
.navbar.is-dark {
    background-color: rgba(15, 23, 42, 0.8) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
}
.navbar-item, .navbar-link {
    color: var(--text-muted) !important;
    transition: color 0.2s;
}
.navbar-item:hover, .navbar-link:hover, .navbar-item.is-active {
    color: var(--text-main) !important;
    background-color: transparent !important;
}
.navbar-brand .navbar-item {
    color: var(--text-main) !important;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Bulma Box Overrides */
.box {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    color: var(--text-main) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2) !important;
}

.box .title, .box .subtitle {
    color: var(--text-main) !important;
}

/* Hero / Header Section */
.page-header {
    padding: 3rem 1.5rem 2rem 1.5rem;
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.08) 0%, transparent 50%);
}

/* Custom Buttons */
.btn-premium {
    background: var(--accent-gradient);
    color: #fff !important;
    border: none;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.6rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px 0 rgba(3, 105, 161, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(3, 105, 161, 0.6);
    opacity: 0.95;
}
.btn-premium:active {
    transform: translateY(0);
}

/* Match Card Grid */
.match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Premium Match Card / Player Card */
.match-card, .player-card {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    color: var(--text-main) !important;
}

.player-card {
    cursor: pointer;
    margin-bottom: 0.5rem;
    padding: 1rem !important;
}

.match-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    transition: background 0.3s;
}
.match-card.status-pågår::before { background: var(--live-color); }
.match-card.status-planlagt::before { background: var(--planned-color); }
.match-card.status-pauset::before { background: var(--paused-color); }
.match-card.status-avsluttet::before { background: var(--completed-color); }

.match-card:hover, .player-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15) !important;
    background-color: rgba(255, 255, 255, 0.02) !important;
}

.player-card:active {
    background-color: rgba(255, 255, 255, 0.06) !important;
}

.match-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.match-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Custom Badges */
.badge-status {
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.badge-status.pågår {
    background-color: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.badge-status.pågår .live-dot {
    width: 8px;
    height: 8px;
    background-color: var(--live-color);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--live-color);
    animation: pulse-live 1.5s infinite;
}
.badge-status.planlagt {
    background-color: rgba(99, 102, 241, 0.12);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}
.badge-status.pauset {
    background-color: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-status.avsluttet {
    background-color: rgba(100, 116, 139, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

@keyframes pulse-live {
    0% { transform: scale(0.85); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.85); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Match Teams styling */
.teams-container {
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.team-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 500;
}
.team-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.team-score {
    font-family: 'Outfit', monospace;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-main);
}
.match-card.status-planlagt .team-score {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 1.1rem;
}

/* Match Meta (sted) */
.match-meta {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.75rem;
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.match-venue {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-card-action {
    color: var(--accent-primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    transition: color 0.2s, transform 0.2s;
}
.match-card:hover .btn-card-action {
    transform: translateX(3px);
    color: #fff;
}

/* Empty State */
.empty-state {
    background-color: var(--card-bg);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    margin-top: 2rem;
}
.empty-state-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Modal Customization for Premium Dark Theme */
.modal-card {
    background-color: #111827 !important;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.modal-card-head {
    background-color: #1f2937 !important;
    border-bottom: 1px solid var(--card-border) !important;
}
.modal-card-title {
    color: var(--text-main) !important;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}
.modal-card-body {
    background-color: #111827 !important;
    color: var(--text-main) !important;
    padding: 1.75rem;
}
.modal-card-foot {
    background-color: #1f2937 !important;
    border-top: 1px solid var(--card-border) !important;
    justify-content: flex-end;
    gap: 0.5rem;
}
.label {
    color: var(--text-muted) !important;
    font-weight: 500;
}
.input, .textarea {
    background-color: #1f2937 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-main) !important;
    border-radius: 8px;
    transition: border-color 0.2s;
}
.input:focus, .textarea:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
}
.input::placeholder, .textarea::placeholder {
    color: #4b5563;
}
.select select {
    background-color: #1f2937 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-main) !important;
    border-radius: 8px;
    transition: border-color 0.2s;
}
.select select:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
}
.select::after {
    border-color: var(--accent-primary) !important;
}
.select select option {
    background-color: #1f2937 !important;
    color: var(--text-main) !important;
}
.button.is-light {
    background-color: #374151 !important;
    color: var(--text-main) !important;
    border: none;
}
.button.is-light:hover {
    background-color: #4b5563 !important;
}
.button.is-static {
    background-color: rgba(100, 116, 139, 0.12) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
}

/* Toast notifications */
#toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    background-color: #1e293b;
    border: 1px solid var(--accent-primary);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    gap: 0.75rem;
    animation: slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slide-in {
    from { transform: translateY(1rem); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* MatchHelper Tool Page Specific Styling */
.is-substituting {
    border: 2px dashed var(--accent-primary) !important;
    background-color: rgba(56, 189, 248, 0.08) !important;
}

.position-header {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: bold;
}

#sub-alert {
    display: none;
    position: sticky;
    top: 0;
    z-index: 100;
}

.time-display {
    font-family: monospace;
    font-size: 0.9em;
    color: var(--text-muted);
}

.match-timer {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: monospace;
    color: var(--accent-primary);
}

#message-output {
    min-height: 2.5rem;
    transition: all 0.3s ease;
    white-space: pre-wrap;
    text-align: left;
    font-family: monospace;
    font-size: 0.9rem;
    max-height: 400px;
    overflow-y: auto;
    border-left: 4px solid var(--accent-primary) !important;
    background-color: #111827 !important;
    color: var(--text-main) !important;
    padding: 1rem;
    border-radius: 8px;
}

/* Bulma overrides for tags in dark mode */
.tag.is-light {
    background-color: #374151 !important;
    color: var(--text-muted) !important;
}
.tag.is-primary.is-light {
    background-color: rgba(56, 189, 248, 0.12) !important;
    color: var(--accent-primary) !important;
}

/* Bulma border override for score line */
.pb-3[style*="border-bottom: 2px solid #f0f0f0;"],
.pb-3[style*="border-bottom: 2px solid"] {
    border-bottom: 2px solid rgba(255, 255, 255, 0.08) !important;
}

/* Fix overlapping titles and subtitles in Bulma */
.title + .subtitle {
    margin-top: 0.5rem !important;
}

/* Report timeline styling */
.timeline-item {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.timeline-item:last-child {
    border-bottom: none;
}
.timeline-time {
    font-family: monospace;
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 1.1rem;
    min-width: 60px;
}
.timeline-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-grow: 1;
}

/* Table styling and text color override for dark theme legibility */
.table {
    background-color: transparent !important;
    color: var(--text-main) !important;
    width: 100%;
}
.table th {
    color: var(--text-muted) !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}
.table td, .table td strong {
    color: var(--text-main) !important;
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
    vertical-align: middle !important;
}
.table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

/* Stat card components */
.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}
.stat-val {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Override Bulma's dark grey color for bold text in dark mode */
strong {
    color: var(--text-main) !important;
}

/* Player selection checklist styles */
.spiller-checkbox-label {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}
.spiller-checkbox-label:hover {
    background: rgba(255, 255, 255, 0.04) !important;
}
.spiller-checkbox-label.is-selected {
    background: rgba(56, 189, 248, 0.12) !important;
    border-color: var(--accent-primary) !important;
}

/* Responsive adjustments for mobile screens */
@media screen and (max-width: 768px) {
    .button.is-medium {
        font-size: 1rem !important;
        padding-top: 0.4rem !important;
        padding-bottom: 0.4rem !important;
        height: auto !important;
    }
}
