/* Redesign Global Styles */

:root {
  --background-dark: #111827;
  --primary-red: #FF3300;
  --text-light: #f3f4f6;
  --text-muted: #9ca3af;
  --border-color: #374151;
}

body {
  background-image: url('../images/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text-light);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-light);
}

p {
    color: var(--text-muted);
}

a {
  color: var(--primary-red);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #ffffff;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}


/* Header and Navigation */
.site-header {
    background-color: var(--background-dark);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-light);
}

.main-menu {
    display: none; /* Hidden on mobile by default */
}

.main-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.main-menu a {
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.main-menu a.btn {
    color: var(--text-light);
    border-bottom: none;
}

.main-menu a.btn-warning {
    color: black;
}


.main-menu a:hover {
    color: var(--text-light);
    border-bottom-color: var(--primary-red);
}

.main-menu a.btn:hover {
    border-bottom-color: transparent;
}

.menu-toggle {
    display: block; /* Show on mobile */
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Desktop Styles */
@media (min-width: 768px) {
    .main-nav {
        flex-grow: 1;
    }
    .menu-toggle {
        display: none;
    }

    .main-menu {
        display: flex;
        justify-content: center;
        flex-grow: 1;
    }

    .main-menu ul {
        width: 100%;
        justify-content: center;
    }

    .user-menu-item {
        margin-left: auto;
    }
    li.user-menu-item:first-of-type {
        margin-left: auto;
    }
    li.user-menu-item + li.user-menu-item {
        margin-left: 1.5rem; /* Same as the gap */
    }

    .main-menu ul li:first-child {
        padding-left: 60px;
    }
}

.main-menu.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px; /* Adjust as needed */
    left: 0;
    width: 100%;
    background-color: var(--background-dark);
    border-top: 1px solid var(--border-color);
}

.main-menu.active ul {
    flex-direction: column;
    width: 100%;
}

.main-menu.active ul li {
    text-align: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.main-menu.active ul li:last-child {
    border-bottom: none;
}



/* Hero Section */
.hero-section {
    text-align: left;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.hero-section h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-red);
}

/* Series Section */
.series-section {
    margin-bottom: 2rem;
}

.series-title {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Generic Grid */
.item-grid, .tournament-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    grid-auto-rows: 1fr;
}

@media (min-width: 768px) {
    .item-grid, .tournament-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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


/* Unified Card Style */
.card {
    background-color: #151515;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 15px var(--primary-red);
}

.card-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-red);
}

.card-body {
    padding: 1.25rem;
    flex-grow: 1;
}

.card-body-flex {
    display: flex;
    align-items: center;
}

.card-info {
    margin: 0 0 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.card-info img {
    margin-right: 10px;
    width: 1em;
    height: 1em;
}

.card-footer {
    min-height: 1rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    background-color: #252525;
}

.card .player-name, .card .team-name-title {
    font-size: 1.3rem;
    margin: 0 0 0.5rem 0;
    color: var(--text-light);
}

.card .team-name, .card .captain-name {
    color: var(--text-muted);
    margin: 0;
}

.card .item-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 15px;
}

.card .stats-link {
    color: var(--primary-red);
    font-weight: 500;
}

/* Utility Classes */
.mt-2 {
    margin-top: 2rem;
}


/* Forms */
.form-container {
    max-width: 500px;
    margin: 2rem auto;
    background-color: #606060;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.form-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.modern-form .form-group {
    margin-bottom: 1.5rem;
}

.modern-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.modern-form input[type=text],
.modern-form input[type=email],
.modern-form input[type=password],
.modern-form textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 0.75rem;
    background-color: var(--background-dark);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 4px;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-red);
    color: var(--text-light);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #802000;
}

.btn-primary {
    width: 100%;
}

.btn-warning {
    background-color: #ffce1b;
}
.btn-warning:hover {
    background-color: #d99706;
}


.error-container {
    background-color: #4b1f24;
    color: #f8b4b4;
    padding: 1rem;
    border: 1px solid #c53030;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.form-footer-text {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
}



.modern-form select {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--background-dark);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 4px;
}

.success-container {
    background-color: #164e32;
    color: #a7f3d0;
    padding: 1rem;
    border: 1px solid #34d399;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    text-align: center;
}


/* Card Grid Layout */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 992px) {
    .card-grid {
        grid-template-columns: 1fr 2fr;
    }
}

/* Player List in Cards */
.player-list {
    list-style: none;
    padding: 0;
}
.player-list li a {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}
.player-list li:last-child a {
    border-bottom: none;
}

/* Small Buttons */
.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* Disabled Button */
.btn.disabled {
    background-color: #555;
    cursor: not-allowed;
    color: var(--text-muted);
}

/* Status Indicators */
.status-approved {
    color: #28a745;
    font-weight: bold;
}
.status-pending {
    color: #ffc107;
}

/* Propositions and Prizes Sections */
.propositions, .prizes {
    padding-left: 1rem;
    border-left: 3px solid var(--border-color);
    margin-top: 0.5rem;
}

/* Admin Forms in Cards */
.admin-registration-form {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Footer Icons */
.footer-icon {
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
}

/* Player score row that doesn't count for team total */
.non-counting-player {
    color: #FF6347; /* Tomato Red */
}

/* Footer */
.site-footer {
    background-color: var(--background-dark);
    color: var(--text-muted);
    text-align: center;
    padding: 0.25rem 0;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
}


/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    margin: 0;
}

.manage-link {
    color: var(--primary-red);
    font-weight: 500;
}

.total-score {
    font-weight: bold;
    text-align: center;
    padding-left: 10px;
}

.player-name-cell {
    padding-right: 10px;
}

.stats-table tbody tr {
    border-bottom: 10px solid transparent;
}

.stats-table .score-value {
    font-weight: bold;
}

.rank-number {
    font-size: 1.2em;
    font-weight: bold;
}

.team-name-muted {
    color: var(--text-muted);
}

.centered-number {
    text-align: center;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* Tables */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

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

.modern-table th {
    font-weight: 600;
    color: var(--text-light);
}

.modern-table tbody tr:nth-child(odd) {
    background-color: rgba(255, 255, 255, 0.05);
}

.modern-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    gap: 0.5rem;
}

.pagination a {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-muted);
    transition: background-color 0.3s, color 0.3s;
}

.pagination a:hover {
    background-color: var(--border-color);
    color: var(--text-light);
}

.pagination a.active {
    background-color: var(--primary-red);
    color: var(--text-light);
    border-color: var(--primary-red);
}

/* Admin Specific */
.admin-page .card .card-header h2 {
    font-size: 1.2rem;
    color: var(--text-light);
}
