/* General Styles */
body {
    font-family: Arial, sans-serif;
    background-color: #DCE1E6;
    color: #000000;
    margin: 0;
    padding: 0;
}

h1, h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #ffffff;
}

h1 {
    font-size: 1.6em;
}

h2 {
    font-size: 1.2em;
}

/* Container */
.container {
    background-color: #DCE1E6;
    position: relative;
    width: 90%;
    max-width: 900px;
    margin: 20px auto;
    padding: 0 10px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Cover Image */
.cover {
    background-image: url("https://images.unsplash.com/photo-1530305408560-82d13781b33a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1352&q=80");
    background-size: cover;
    background-repeat: no-repeat;
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
}

/* Section Title */
.section-title {
    font-size: 1em;
    margin-bottom: 5px;
    text-align: center;
    text-decoration: underline;
    color: #ffffff;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    background-color: #111111;
    color: #888888;
    font-size: 0.75em;
}

#footer a {
    color: inherit;
    text-decoration: none;
}

#footer a:hover {
    text-decoration: underline;
}

/* Buttons */
.button {
    display: inline-block;
    padding: 10px 20px;
    margin-top: 20px;
    background-color: #444444;
    color: #ffffff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s;
}

.button:hover {
    background-color: #555555;
}

/* Table Styles */
.table-wrapper {
    margin: 0;
    padding: 0;
}

.table {
    table-layout: auto; /* Automatically adjust column widths based on content */
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

.table th,
.table td {
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis; /* Show ellipsis for overflowing text */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Break long words */
    font-size: 0.9em;
    padding: 8px;
}

.table-bordered th,
.table-bordered td {
    border: 2px solid black;
}

.table a {
    color: black;
    text-decoration: none;
}

.table a:hover {
    color: #555;
    text-decoration: underline;
}

/* Table Header */
.table thead th {
    background-color: #343a40;
    color: white;
    text-align: center;
    white-space: nowrap; /* Prevent wrapping in headers */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Column Width Adjustments */
.table th:nth-child(1), /* Competition column */
.table td:nth-child(1) {
    min-width: 30%; /* Larger space for longer competition names */
}

.table th:nth-child(2), /* Category column */
.table td:nth-child(2) {
    min-width: 25%; /* Moderate space for categories */
    max-width: 35%; /* Prevent over-expansion */
}

.table th:nth-child(3), /* Place column */
.table td:nth-child(3) {
    min-width: 5%; /* Smallest space for single numbers */
    max-width: 10%;
    text-align: center; /* Align numbers */
}

.table th:nth-child(4), /* Team column */
.table td:nth-child(4) {
    min-width: 20%; /* Moderate space for team names */
}

/* Responsive Table Adjustments */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.3em;
    }

    h2 {
        font-size: 1em;
    }

    .table th,
    .table td {
        font-size: 0.7em;
        padding: 4px;
    }

    .table th:nth-child(1),
    .table td:nth-child(1) {
        min-width: 40%; /* More space for competition on smaller screens */
    }

    .table th:nth-child(2),
    .table td:nth-child(2) {
        min-width: 30%; /* Adjust category space */
    }

    .table th:nth-child(3),
    .table td:nth-child(3) {
        min-width: 10%; /* Slightly more space for place */
    }
}

@media (max-width: 400px) {
    .table th,
    .table td {
        font-size: 0.6em;
        padding: 2px;
    }

    .table th:nth-child(1),
    .table td:nth-child(1) {
        min-width: 50%; /* Maximum space for competition names */
    }

    .table th:nth-child(2),
    .table td:nth-child(2) {
        min-width: 30%;
    }

    .table th:nth-child(3),
    .table td:nth-child(3) {
        min-width: 10%;
    }
}

/* Ranking Items */
.ranking-item {
    text-align: center;
    cursor: pointer;
    transition: color 0.3s ease;
}

.ranking-item:hover {
    background-color: #f8f9fa;
    color: #555;
}
