:root {
    --bg-color: #2c5919;
    --input-bg: #cacaca;
    --btn-bg: #1d3913;
    --text-primary: #ffffff;
    --accent-color: #4caf50;
    --card-bg: rgba(255, 255, 255, 0.05);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

.sponsor-banner {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0;
    margin: 0;
    margin-bottom: 15px;
}

.sponsor-banner img {
    width: 100%;
    max-width: 500px;
    height: auto;
    object-fit: contain;
}

/* Attendance Controls */
.attendance-controls {
    max-width: 450px;
    margin: 0 auto 20px auto;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 35px;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0; width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 22px;
    width: 22px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: rgba(255, 255, 255, 0.2);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #4caf50;
    border-color: #4caf50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Player Box with Checkbox */
.player-box {
    display: flex;
    align-items: center;
    gap: 15px;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.player-box.absent {
    opacity: 0.35;
    filter: grayscale(0.5);
}

.player-info-click {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#app-container {
    width: 100%;
    max-width: 850px;
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Typography */
h1, h2, h3 {
    margin-bottom: 1rem;
    font-weight: 700;
}

/* UI Elements */
input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--input-bg);
    border: none;
    border-radius: 8px;
    margin-bottom: 15px;
    color: #333;
    font-size: 1rem;
}

button, .btn {
    width: 100%;
    padding: 12px;
    background-color: var(--btn-bg);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

/* Navigation */
.bottom-nav {
    display: none; /* Hidden by default until front loading is done */
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 850px;
    height: 70px;
    background: rgba(29, 57, 19, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    z-index: 2;
    flex: 1;
}

.nav-item.active {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.nav-item.active i {
    filter: drop-shadow(0 0 8px #ffffff);
}

.nav-item i {
    font-size: 1.5rem;
    margin-bottom: 4px;
    transition: all 0.3s;
}

.nav-indicator {
    position: absolute;
    bottom: 12px; /* Positioned at the bottom */
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ffffff, transparent);
    background-size: 200% 100%;
    border-radius: 2px;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    animation: waveEffect 2s linear infinite;
}

@keyframes waveEffect {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Content Transitions */
#page-content {
    padding: 0px 20px 20px 20px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading Overlay for front.php */
.loader-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--bg-color);
    z-index: 2000;
}

.logo-container {
    position: relative;
    width: 150px;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-outer {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: rotateLogo 3s linear infinite;
}

.logo-inner {
    position: absolute;
    width: 60%;
    height: 60%;
    z-index: 2;
}

@keyframes rotateLogo {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Member Page Specific Styles */
.player-input-container {
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.page-title {
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    text-transform: uppercase;
}

.player-list {
    width: 100%;
    max-width: 450px; /* Constrained width */
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.player-box {
    background-color: var(--input-bg);
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.1);
}

.player-group {
    color: #666;
    font-size: 0.9rem;
}

.action-area {
    width: 100%;
    max-width: 450px; /* Constrained width */
    display: flex;
    justify-content: center;
}

.btn-create-match {
    width: 100%;
    background-color: var(--btn-bg);
    color: white;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

/* Global UI Components */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 400px;
    border-radius: 15px;
    overflow: hidden;
    color: #333;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-modal {
    background: #f0f0f0;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-modal:hover {
    background: #e0e0e0;
    color: #333;
}

.modal-body {
    padding: 20px;
    line-height: 1.5;
}

.modal-footer {
    padding: 15px 20px;
    background: #f9f9f9;
    text-align: right;
}

.btn-close-modal {
    width: auto;
    padding: 8px 20px;
    display: inline-block;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--btn-bg);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    animation: slideLeft 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Floating Action Button */
.fab-add-player {
    position: fixed;
    bottom: 90px; /* Above bottom nav */
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #ffffff;
    color: var(--bg-color);
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
}

.fab-add-player:hover {
    transform: scale(1.1) rotate(90deg);
}

/* Futuristic Match Loader */
.match-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 25, 6, 0.98);
    backdrop-filter: blur(15px);
    z-index: 9999;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #4caf50;
    font-family: 'Courier New', Courier, monospace;
}

/* Match Page Styles */
.match-tabs-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 10px 0;
    margin-bottom: 20px;
    scrollbar-width: none; /* Firefox */
}

.match-tabs-wrapper::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.match-tabs {
    display: flex;
    gap: 10px;
    padding: 0 10px;
    min-width: max-content;
}

.match-tab {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.match-tab.active {
    background: #ffffff;
    color: var(--bg-color);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.match-details-container {
    padding: 10px;
}

.match-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.4s ease;
}

.match-header-info {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 800;
    color: #4caf50;
    letter-spacing: 2px;
}

.match-versus {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.team-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vs-divider {
    font-style: italic;
    font-weight: 900;
    font-size: 1.5rem;
    opacity: 0.5;
}

/* Court Layout */
.court-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.court-field {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 513 / 755;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.court-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
    position: absolute;
    top: 0; left: 0;
}

.court-team {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 20px 10px;
}

.court-team-home { padding-top: 25px; }
.court-team-away { padding-bottom: 25px; }

.court-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.player-icon {
    width: 60px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

.court-player-label {
    background: rgba(0, 0, 0, 0.75);
    border-radius: 8px;
    padding: 4px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-width: 80px;
}

.court-player-name {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    white-space: nowrap;
}

.court-player-group {
    color: rgba(255,255,255,0.6);
    font-size: 0.7rem;
    text-align: center;
}

.court-center-banner {
    position: relative;
    z-index: 3;
    background: linear-gradient(135deg, #f5c518, #e6a800);
    color: #1a1a00;
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: 3px;
    padding: 10px 40px;
    border-radius: 50px;
    border: 3px solid #a87000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.3);
    margin: 5px 0;
}

.court-type-badge {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 20px;
    border-radius: 20px;
    letter-spacing: 1px;
}

.scan-line {
    width: 100%;
    height: 2px;
    background: rgba(76, 175, 80, 0.5);
    position: absolute;
    top: 0;
    box-shadow: 0 0 15px #4caf50;
    animation: scanMove 2s linear infinite;
}

.match-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 5001;
}

.cyber-spinner {
    width: 100px;
    height: 100px;
    border: 2px solid transparent;
    border-top: 2px solid #4caf50;
    border-bottom: 2px solid #4caf50;
    border-radius: 50%;
    animation: cyberSpin 1s linear infinite;
    position: relative;
    margin: 0 auto 20px auto;
}

.cyber-spinner::before {
    content: '';
    position: absolute;
    top: 10px; left: 10px; right: 10px; bottom: 10px;
    border: 2px solid transparent;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #ffffff;
    border-radius: 50%;
    animation: cyberSpinReverse 1.5s linear infinite;
}

@keyframes scanMove {
    0% { top: 0; }
    100% { top: 100%; }
}

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

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

.loading-text {
    font-size: 1.2rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 15px;
    animation: pulseText 1s infinite;
}

@keyframes pulseText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

