/* Rykker Godset Opp? – Styles */

:root {
    --godset-blue: #002145;
    --godset-blue-light: #003366;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-600: #6c757d;
    --gray-900: #212529;
    --win: #28a745;
    --draw: #ffc107;
    --loss: #dc3545;
    --promotion: #28a745;
    --qualification: #17a2b8;
    --relegation: #dc3545;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.site-header {
    background: var(--godset-blue);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
    border-bottom: 4px solid var(--godset-blue-light);
}

.site-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.site-subtitle {
    font-size: 0.95rem;
    opacity: 0.85;
    font-weight: 400;
}

/* Hero */
.hero {
    padding: 2rem 0;
    text-align: center;
}

/* Gauge */
.gauge {
    max-width: 380px;
    margin: 0 auto 1.5rem;
}

.gauge-bar {
    position: relative;
    height: 36px;
    border-radius: 18px;
    background: linear-gradient(to right, #dc3545 0%, #dc3545 33.3%, #ffc107 33.3%, #ffc107 66.6%, #28a745 66.6%, #28a745 100%);
    overflow: visible;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}

.gauge-needle {
    position: absolute;
    top: -6px;
    bottom: -6px;
    width: 4px;
    background: var(--gray-900);
    border-radius: 2px;
    transform: translateX(-50%);
    z-index: 2;
    transition: left 0.5s ease;
}

.gauge-needle::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 14px solid var(--gray-900);
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    font-weight: 700;
    font-size: 0.95rem;
}

.gauge-labels span:nth-child(1) { color: #dc3545; }
.gauge-labels span:nth-child(2) { color: #b38600; }
.gauge-labels span:nth-child(3) { color: #28a745; }

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--godset-blue);
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

/* Sections */
.section {
    background: var(--white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--godset-blue);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
}

.section-link {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.section-link a {
    color: var(--godset-blue);
    text-decoration: none;
    font-weight: 600;
}

.section-link a:hover {
    text-decoration: underline;
}

/* Stats Grid */
.stats-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.stat-card {
    background: var(--gray-100);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: calc(50% - 0.375rem);
    max-width: 220px;
}

@media (min-width: 600px) {
    .stat-card {
        width: calc(33.333% - 0.5rem);
    }
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--godset-blue);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-600);
}

.stat-positive {
    border-left: 4px solid var(--win);
}

.stat-warning {
    border-left: 4px solid var(--draw);
}

.stat-negative {
    border-left: 4px solid var(--loss);
}

/* Promotion Grid */
.promo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.promo-grid-3 {
    grid-template-columns: 1fr;
}

@media (min-width: 600px) {
    .promo-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.promo-item {
    background: var(--gray-100);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-left: 4px solid var(--gray-300);
}

.promo-positive {
    border-left-color: var(--win);
}

.promo-warning {
    border-left-color: var(--draw);
}

.promo-negative {
    border-left-color: var(--loss);
}

.promo-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--godset-blue);
}

.promo-label {
    font-size: 0.8rem;
    color: var(--gray-600);
}

/* Form */
.form-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}

.form-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--white);
}

.form-w {
    background: var(--win);
}

.form-d {
    background: var(--draw);
    color: var(--gray-900);
}

.form-l {
    background: var(--loss);
}

.form-points {
    text-align: center;
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* Matches */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.match-row {
    display: grid;
    grid-template-columns: 5rem 1fr auto 5rem;
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: var(--gray-100);
    font-size: 0.9rem;
}

.match-w {
    border-left: 4px solid var(--win);
}

.match-d {
    border-left: 4px solid var(--draw);
}

.match-l {
    border-left: 4px solid var(--loss);
}

.match-upcoming {
    border-left: 4px solid var(--gray-300);
}

.match-date {
    color: var(--gray-600);
    font-size: 0.8rem;
}

.match-teams {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-score {
    font-weight: 700;
    color: var(--godset-blue);
    text-align: center;
}

.match-result {
    font-size: 0.8rem;
    text-align: right;
    color: var(--gray-600);
}

.match-round {
    font-size: 0.8rem;
    color: var(--gray-600);
    text-align: right;
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.league-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.league-table th {
    background: var(--godset-blue);
    color: var(--white);
    padding: 0.625rem 0.5rem;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
}

.league-table th:first-child {
    border-top-left-radius: 0.5rem;
}

.league-table th:last-child {
    border-top-right-radius: 0.5rem;
}

.league-table td {
    padding: 0.625rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid var(--gray-200);
}

.league-table td.pos {
    font-weight: 700;
    width: 2rem;
}

.league-table td.team {
    text-align: left;
    font-weight: 500;
    white-space: nowrap;
}

.league-table td.points {
    font-weight: 700;
    color: var(--godset-blue);
}

/* Table row zone backgrounds */
.league-table tbody tr.promotion {
    background: rgba(40, 167, 69, 0.08);
}

.league-table tbody tr.qualification {
    background: rgba(23, 162, 184, 0.08);
}

.league-table tbody tr.relegation {
    background: rgba(220, 53, 69, 0.08);
}

.league-table tbody tr.highlight {
    background: rgba(0, 33, 69, 0.12);
    font-weight: 600;
}

/* Hover effects */
.league-table tbody tr.promotion:hover {
    background: rgba(40, 167, 69, 0.15);
}

.league-table tbody tr.qualification:hover {
    background: rgba(23, 162, 184, 0.15);
}

.league-table tbody tr.relegation:hover {
    background: rgba(220, 53, 69, 0.15);
}

.league-table tbody tr.highlight:hover {
    background: rgba(0, 33, 69, 0.2);
}

/* Position number colors */
.league-table tbody tr.promotion td.pos {
    color: var(--promotion);
}

.league-table tbody tr.qualification td.pos {
    color: var(--qualification);
}

.league-table tbody tr.relegation td.pos {
    color: var(--relegation);
}

/* Legend */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    color: var(--gray-600);
}

.legend-box {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
}

.legend-box.promotion {
    background: var(--promotion);
}

.legend-box.qualification {
    background: var(--qualification);
}

.legend-box.relegation {
    background: var(--relegation);
}

.legend-box.highlight {
    background: var(--godset-blue);
}

/* Footer */
.site-footer {
    background: var(--godset-blue);
    color: var(--white);
    padding: 1.5rem 0;
    text-align: center;
    margin-top: 2rem;
    font-size: 0.85rem;
}

.site-footer a {
    color: var(--white);
    text-decoration: underline;
    opacity: 0.85;
}

.site-footer a:hover {
    opacity: 1;
}

.footer-note {
    margin-top: 0.5rem;
    opacity: 0.7;
    font-size: 0.75rem;
}

/* Utilities */
@media (max-width: 480px) {
    .site-title {
        font-size: 1.5rem;
    }

    .hero-stat-value {
        font-size: 2rem;
    }

    .match-row {
        grid-template-columns: 4rem 1fr auto;
    }

    .match-result {
        display: none;
    }

    .hide-mobile {
        display: none;
    }
}
