/* General Link Styling */
a, a:visited {
    color: #79aec8; /* A light, accessible blue */
    text-decoration: none;
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

a:hover, a:focus {
    color: #a1cde8; /* Lighter blue on hover */
    text-decoration: underline;
    transform: scale(1.05); /* Slightly enlarge on hover for better touch feedback */
}

/* General Body and Text */
body {
    background-color: #1a1a1a; /* Very dark gray */
    color: #e0e0e0; /* Light gray for text */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

/* Header */
header {
    background-color: #333;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Navbar */
.navbar {
    background-color: #333; /* Darker gray for navbar */
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    color: #fff; /* White for brand */
    font-size: 1.5em;
    font-weight: bold;
    text-decoration: none;
    margin-right: 20px;
}

.navbar-item {
    color: #ccc; /* Lighter gray for items */
    text-decoration: none;
    padding: 10px 15px;
    transition: background-color 0.3s ease;
}

.navbar-item:hover {
    background-color: #555; /* Slightly lighter on hover */
    border-radius: 5px;
}

.navbar-item-button {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    padding: 10px 15px;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: block;
}

.navbar-user {
    display: flex;
    align-items: center;
    margin-left: auto; /* Pushes the user block to the right */
}

.navbar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover; /* Ensures the image covers the circle without distortion */
    margin-left: 15px;
    border: 2px solid #fff;
    transition: transform 0.2s ease-in-out;
}


.navbar-item-button:hover {
    background-color: #555;
    border-radius: 5px;
}

/* Content Area */
.body-content {
    padding: 20px;
    max-width: 900px;
    margin: 20px auto;
    background-color: #2a2a2a; /* Slightly lighter dark gray for content */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

h1, h2 {
    color: #f0f0f0; /* Off-white for headings */
    text-align: center;
    margin-bottom: 20px;
}

/* Tables (General) */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #3a3a3a; /* Darker background for tables */
    border-radius: 8px;
    overflow: hidden; /* Ensures rounded corners apply to table content */
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #4a4a4a; /* Subtle border */
    color: #e0e0e0;
}

th {
    background-color: #4a4a4a; /* Even darker for table headers */
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    font-size: 0.9em;
}

tbody tr:nth-child(odd) {
    background-color: #333; /* Alternating row colors */
}

tbody tr:nth-child(even) {
    background-color: #3a3a3a;
}

tbody tr:hover {
    background-color: #555; /* Highlight on hover */
}

/* Specifics for Fixtures Page (using .module and .results from admin styles) */
.module {
    background-color: #3a3a3a;
    border: 1px solid #4a4a4a;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden; /* For responsive tables */
}

.module h2 {
    background-color: #4a4a4a;
    color: #fff;
    padding: 10px 15px;
    margin: 0;
    font-size: 1.2em;
    border-bottom: 1px solid #5a5a5a;
    text-align: left; /* Override center alignment for module titles */
}

.module .results {
    padding: 15px;
    overflow-x: auto; /* Make tables horizontally scrollable on small screens */
}

/* Image badges in tables */
td img {
    vertical-align: middle;
    margin-right: 5px;
}

/* Form elements (login/register) */
form {
    background-color: #3a3a3a;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    margin-top: 20px;
}

form p {
    margin-bottom: 15px;
}

form label {
    display: block;
    margin-bottom: 5px;
    color: #e0e0e0;
}

form input[type="text"],
form input[type="password"],
form input[type="number"] {
    width: calc(100% - 22px); /* Account for padding and border */
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #444;
    color: #e0e0e0;
    box-sizing: border-box; /* Include padding in width */
}

form input[type="text"]:focus,
form input[type="password"]:focus,
form input[type="number"]:focus {
    border-color: #66b3ff; /* Highlight on focus */
    outline: none;
}

form button[type="submit"] {
    background-color: #007bff; /* Blue button */
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

form button[type="submit"]:hover {
    background-color: #0056b3; /* Darker blue on hover */
}

/* Link styled as a button */
.button-link {
    display: inline-block;
    padding: 10px 15px;
    margin: 5px;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.button-link:hover {
    background-color: #0056b3;
    color: white; /* Ensure text color remains white on hover */
}

/* Google Sign-in Button Styles */
.google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #4285F4;
    color: #fff;
    border-radius: 4px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
    width: 220px; /* Adjusted width */
    height: 40px; /* Standard height */
    transition: background-color .3s, box-shadow .3s;
    box-shadow: 0 2px 4px 0 rgba(0,0,0,.25);
}

.google-btn:hover {
    background-color: #3367D6;
    box-shadow: 0 3px 5px 0 rgba(0,0,0,.25);
    text-decoration: none; /* Override general link hover */
}

.google-icon-wrapper {
    background-color: #fff;
    padding: 1px;
    border-radius: 3px;
    margin-right: 12px;
}
/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar-brand {
        margin-bottom: 10px;
    }

    .navbar-item {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }

    .body-content {
        padding: 15px;
        margin: 15px;
    }

    th, td {
        padding: 8px 10px;
        font-size: 0.85em;
    }
}

.team-name-full {
    display: inline;
}
.team-name-short {
    display: none;
}

/* For screens smaller than 600px, show short names and hide full names */
@media screen and (max-width: 600px) {
    .team-name-full {
        display: none;
    }
    .team-name-short {
        display: inline;
    }
}

/* Hide mobile-only prediction cell on desktop */
.prediction-mobile-cell {
    display: none;
}

/* --- Responsive Styles for Mobile --- */
@media (max-width: 768px) {
    .team-name-full {
        display: none;
    }
    .team-name-short {
        display: inline;
    }

    /* Hide table headers, they are not needed in card view */
    .prediction-table thead {
        display: none;
    }

    /* Hide table headers on mobile */
    .prediction-table thead {
        display: none;
    }

    /* Make table elements behave like blocks for the card layout */
    .prediction-table, .prediction-table tbody, .prediction-table .match-row {
        display: block;
    }

    /* Style each row as a card and set up the 12-column grid */
    .prediction-table .match-row {
        border: 1px solid #4a4a4a;
        border-radius: 8px;
        margin-bottom: 1em;
        padding: 10px;
        background-color: #2a2a2a;
        display: grid;
        grid-template-columns: repeat(12, 1fr);
        grid-template-rows: auto auto;
        gap: 5px;
        align-items: center;
    }

    /* Make table cells direct grid items */
    .prediction-table td {
        display: contents; /* This makes the TD's children direct grid items */
        border: none;
        padding: 0;
    }

    /* Show the mobile prediction cell and make it a grid item */
    .prediction-mobile-cell {
        display: contents;
    }

    /* --- Grid Placements based on 12-column spec --- */

    /* Row 1 Placements */
    .match-row .mc-home-name-and-score > span { grid-column: 3 / 6; grid-row: 1; text-align: right; }
    .match-row .mc-home-badge { grid-column: 6; grid-row: 1; justify-self: center; }
    .match-row .mc-vs-and-sep > .mc-vs { grid-column: 7; grid-row: 1; justify-self: center; }
    .match-row .mc-away-badge { grid-column: 8; grid-row: 1; justify-self: center; }
    .match-row .mc-away-name-and-score > span { grid-column: 9 / 12; grid-row: 1; text-align: left; }
    .match-row .mc-captain { grid-column: 12; grid-row: 1; justify-self: center; }

    /* Row 2 Placements */
    .match-row .mc-date { grid-column: 1 / 3; grid-row: 2; font-size: 0.8em; line-height: 1.2; text-align: center; }
    .match-row .mc-home-name-and-score .mc-home-score { grid-column: 4 / 7; grid-row: 2; justify-self: center; }
    .match-row .mc-vs-and-sep > .mc-score-sep { grid-column: 7; grid-row: 2; justify-self: center; }
    .match-row .mc-away-name-and-score .mc-away-score { grid-column: 8 / 11; grid-row: 2; justify-self: center; }

    /* Hide the 'vs' on mobile and show the '-' separator */
    .match-row .mc-vs { display: block; }
    .match-row .mc-score-sep { display: block; }

    /* Final score display */
    .final-score {
        text-align: center; /* Center the final score text */
    }

    /* Hide the desktop prediction row on mobile */
    .prediction-row {
        display: none;
    }

    /* Style and place the mobile-specific prediction element */
    .prediction-mobile {
        grid-column: 1 / -1; /* Span all 12 columns */
        grid-row: 3; /* Place it on a new third row */
        text-align: center;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px dashed #4a4a4a;
        font-size: 0.9em;
        color: #ccc;
    }
    .prediction-mobile-score {
        font-weight: bold;
        color: #8dbad8;
        margin-left: 5px;
    }
}

/* Hide spinners from number inputs for a cleaner look */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield; /* Firefox */
}

/* Style for the predicted score text */
.prediction-score {
    text-align: left !important;
    font-weight: bold !important;
    color: #8dbad8 !important; /* A slightly brighter blue for visibility */
}

/* Adjust padding for the prediction cell */
.prediction-row .prediction-score-cell {
    padding: 12px 15px !important;
}
