* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
    background: linear-gradient(to top, #40e0d0, #000000) !important;
    color: var(--black);
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 2rem 1.25rem 2.5rem;
}

.content-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.matches-container,
.standings-container {
    min-width: 0;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.standings-container {
    text-align: left;
    margin-bottom: 2rem;
}

#standingsContainer {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

h1 {
    color: #2c3e50;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.2;
    text-align: center;
    margin-bottom: 2rem;
    overflow-wrap: anywhere;
}

/* Matches styles */
#matchday {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#matches {
    list-style: none;
    padding: 0;
}

#matches li {
    background: #ffffff;
    margin-bottom: 0.5rem;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.match-info {
    font-weight: bold;
    margin-bottom: 0.5rem;
    overflow-wrap: anywhere;
}

.match-date {
    font-size: 0.9rem;
    color: #666;
}

/* Standings styles */
#fetchStandings {
    background: #40e0d0;
    color: #000000;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    width: 100%;
    margin-bottom: 1rem;
}

#fetchStandings:hover {
    background: rgba(64, 224, 208, 0.6);
}

.standings-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.standings-table th {
    background: #40e0d0;
    color: #000000 !important;
}

.team-column-header {
    text-align: left;
    padding-left: 12px;
}

.special-title {
    color: var(--primary-turquoise);
    text-shadow: 0 0 10px rgba(64, 224, 208, 0.6);
}

.standings-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.standings-table th,
.standings-table td {
    white-space: nowrap;
}

.standings-table tr:nth-child(even) {
    background: #f9f9f9;
}

.standings-table tr:hover {
    background: #f5f5f5;
}

.stats-cell {
    text-align: center;
}

.loader {
    display: none;
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid rgba(64, 224, 208, 0.6);
    width: 24px;
    height: 24px;
    animation: loader-spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes loader-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.project-description {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 2rem;
}

.project-section-title {
    color: #000000;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 15px;
}

.project-text {
    color: #000000;
    font-size: 1.1rem;
    margin-bottom: 20px;
    text-align: justify;
}

.project-link {
    color: #3498db;
    text-decoration: none;
}

.project-details-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
    margin-top: 20px;
}

.project-details-column {
    flex: 1;
    min-width: 250px;
}

.project-subtitle {
    color: #000000;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.project-list {
    color: #000000;
    font-size: 1rem;
    padding-left: 20px;
}

.project-list-spaced {
    margin-bottom: 20px;
}

.project-figure {
    flex: 1;
    min-width: 300px;
    text-align: center;
}

.project-figure-image {
    width: 100%;
    max-width: 1100px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.project-figure-caption {
    color: #000000;
    font-size: 0.9rem;
    margin-top: 10px;
}

.back-button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: rgba(64, 224, 208, 0.9) !important;
    color: #000000 !important;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin: 150px 0 2rem 0;
    font-weight: bold;
    border: 2px solid #40e0d0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 100;
}

@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .project-details-column,
    .project-figure {
        min-width: 0;
    }

    .project-details-grid {
        flex-direction: column;
    }

    .project-details-column {
        order: 1;
    }

    .project-figure {
        order: 2;
        width: 100%;
        margin-top: 0.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem 0.75rem 2rem;
    }

    h1 {
        font-size: clamp(1.7rem, 8.5vw, 2.3rem);
        margin-bottom: 1.25rem;
    }

    .back-button {
        margin: 140px 0 1.25rem 0;
    }

    .content-wrapper {
        gap: 1rem;
    }

    .matches-container,
    .standings-container,
    .project-description {
        padding: 1rem;
    }

    #fetchStandings {
        font-size: 1rem;
        padding: 0.85rem 1rem;
    }

    #matches li {
        padding: 0.8rem;
    }

    .match-info {
        font-size: 1.05rem;
    }

    .match-date {
        font-size: 0.85rem;
    }

    .standings-table {
        min-width: 100%;
        table-layout: fixed;
    }

    .standings-table th,
    .standings-table td {
        padding: 8px 6px;
        font-size: 0.82rem;
        white-space: normal;
        word-break: break-word;
    }

    .standings-table th:first-child,
    .standings-table td:first-child {
        width: 46%;
        text-align: left;
        padding-left: 8px;
        font-size: 0.9rem;
    }

    .stats-cell,
    .standings-table th:not(:first-child) {
        width: 7.7%;
        text-align: center;
        padding-left: 0;
        padding-right: 0;
    }

    .project-section-title {
        font-size: 1.5rem;
    }

    .project-text {
        font-size: 1rem;
    }

    .project-subtitle {
        font-size: 1.25rem;
    }

    .project-list {
        font-size: 0.95rem;
    }

    .project-figure-image {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: clamp(1.45rem, 8vw, 1.85rem);
    }

    .standings-table {
        min-width: 100%;
    }

    .standings-table th,
    .standings-table td {
        font-size: 0.75rem;
        padding: 7px 4px;
    }

    .standings-table th:first-child,
    .standings-table td:first-child {
        width: 50%;
        font-size: 0.83rem;
        padding-left: 6px;
    }

    #matches li {
        padding: 0.7rem;
    }

    .project-details-grid {
        gap: 14px;
    }
}
