/* Basic styling */
:root {
    --primary-color: #5A8C55; /* Darker Pickle Green */
    --primary-color-dark: #456B42;
    --secondary-color: #8ABF83; /* Light Pickle Green */
    --danger-color: #EA4335; /* Google Red */
    --warning-color: #FBBC05; /* Google Yellow */
    --background-color: #F5F5F5; /* Off White */
    --surface-color: #ffffff;
    --on-primary-color: #ffffff;
    --on-surface-color: #212121; /* Dark Text */
    --on-surface-variant-color: #616161;
    --border-color: #E0E0E0;
    --font-family: 'Roboto', sans-serif;
    --box-shadow: 0 1px 2px 0 rgba(60,64,67,0.302), 0 1px 3px 1px rgba(60,64,67,0.149);
    --border-radius: 8px;
}

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--on-surface-color);
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.main-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    margin: 0;
    font-weight: 400;
}

.winner-icon {
    border: 4px solid var(--warning-color);
    box-shadow: 0 0 10px var(--warning-color);
}

.loser-icon {
    opacity: 0.6;
}

/* Header and Navbar */
.header {
    background-color: var(--primary-color);
    border-bottom: 1px solid var(--primary-color-dark);
    padding: 10px 0;
    margin-bottom: 20px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5em;
    font-weight: 500;
    color: var(--on-primary-color);
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 20px; /* spacing between menu items */
}

.navbar-menu a {
    text-decoration: none;
    color: var(--on-primary-color);
}


.navbar-user-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hamburger-menu {
    display: none;
}

.hamburger-menu, .navbar-right {
    display: none;
}

.profile-picture-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Forms */
.form-container {
    max-width: 500px;
    margin: 40px auto;
    padding: 32px;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.form-container h2 {
    margin-top: 0;
    text-align: center;
    font-weight: 400;
    font-size: 24px;
    margin-bottom: 24px;
}

form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--on-surface-variant-color);
    font-size: 14px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
    background-color: var(--background-color);
    color: var(--on-surface-color);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(90, 140, 85, 0.2);
}

input,
textarea,
select {
    user-select: auto !important;
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
}

input[type="submit"], .btn {
    background-color: var(--primary-color);
    color: var(--on-primary-color);
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .5px;
    transition: background-color 0.2s ease-in-out;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.btn:hover {
    background-color: var(--primary-color-dark);
}

.btn-primary {
    background-color: var(--secondary-color);
}

.btn-danger {
    background-color: var(--danger-color);
}

.btn-warning {
    background-color: var(--warning-color);
    color: var(--on-surface-color);
}

/* Tables */
.table-container {
    background-color: var(--surface-color);
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th, .table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--background-color);
    font-weight: 500;
    color: var(--on-surface-variant-color);
    font-size: 14px;
}

.table tr:last-child td {
    border-bottom: none;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--surface-color);
    min-width: 220px;
    box-shadow: var(--box-shadow);
    z-index: 1;
    border-radius: var(--border-radius);
    overflow: hidden;
    padding-top: 8px;
    padding-bottom: 8px;
}

.dropdown-content a {
    color: var(--on-surface-color);
    padding: 10px 20px;
    text-decoration: none;
    display: block;
    font-size: 14px;
}

.dropdown-content a:hover {
    background-color: var(--background-color);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Alerts */
.flashes {
    margin: 20px 0;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

/* Admin Banner */
.admin-banner {
    background-color: var(--warning-color);
    color: var(--on-surface-color);
    text-align: center;
    padding: 4px;
    font-size: 0.9em;
    font-weight: 500;
}

/* Cards */
.card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 24px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.grid-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

/* Match Cards */
.match-card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-top: 20px;
    overflow: hidden;
}

.match-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.match-header h2 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 400;
}

.match-date {
    color: var(--on-surface-variant-color);
    font-size: 0.9em;
}

.match-body {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 20px;
}

.player-details {
    text-align: center;
}

.player-details h3 {
    font-weight: 500;
    margin-top: 10px;
    margin-bottom: 5px;
}

.score-details {
    font-size: 2.5em;
    font-weight: 500;
    color: var(--primary-color);
}

.separator {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--on-surface-variant-color);
}


/* Profile */
.profile-header {
    text-align: center;
    margin-bottom: 30px;
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.profile-picture {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 4px solid var(--surface-color);
    box-shadow: var(--box-shadow);
}

.profile-header h1 {
    margin: 0;
    font-weight: 400;
}


/* List Group */
.list-group {
    list-style: none;
    padding: 0;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.list-group-item {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
}

.list-group-item:last-child {
    border-bottom: none;
}

/* Hero section */
.hero {
    text-align: center;
    padding: 80px 20px;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.hero h1 {
    font-size: 3em;
    font-weight: 400;
    margin: 0;
}

.hero p {
    font-size: 1.2em;
    color: var(--on-surface-variant-color);
    max-width: 600px;
    margin: 20px auto;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: var(--surface-color);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    width: 80%;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.modal-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h5 {
    margin: 0;
    font-weight: 500;
}

.close {
    color: var(--on-surface-variant-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: var(--on-surface-color);
    text-decoration: none;
    cursor: pointer;
}

.modal-body {
    padding: 16px;
}


/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    color: var(--on-surface-variant-color);
    font-size: 0.9em;
}

/* Utility */
.text-center {
    text-align: center;
}

.winning-score {
    font-weight: bold;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background-color: var(--background-color);
}

.header-with-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    margin-bottom: 10px;
}

.header-with-button h3 {
    margin: 0;
}

.header-with-button .btn {
    width: auto; /* Override the 100% width for buttons */
    margin-top: 0;
}

/* Loading Spinner */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loader {
    border: 5px solid var(--background-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.highlight-row {
    background-color: var(--warning-color) !important;
    font-weight: bold;
}
