:root {
    --primary-green: #00ff00;
    --dark-green: #004d00;
    --off-black: #121212;
    --pure-white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--off-black);
    color: var(--pure-white);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.container {
    max-width: 800px;
    padding: 2rem;
    text-align: center;
}

.logo {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.1);
}

.tagline {
    font-size: 1.5rem;
    color: var(--pure-white);
    margin-bottom: 2rem;
    font-weight: 500;
}

.description {
    font-size: 1.1rem;
    color: #e0e0e0;
    max-width: 600px;
    margin: 0 auto 3rem auto;
    line-height: 1.8;
}

.cta-container {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.cta-button {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.cta-primary {
    background: var(--primary-green);
    color: var(--off-black);
    border: 2px solid var(--primary-green);
}

.cta-primary:hover {
    background: var(--dark-green);
    border-color: var(--dark-green);
    color: var(--pure-white);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
}

.cta-secondary {
    background: transparent;
    color: var(--pure-white);
    border: 2px solid var(--pure-white);
}

.cta-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.glow-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--primary-green), 
        transparent
    );
    animation: glow 4s linear infinite;
}

@keyframes glow {
    0% {
        opacity: 0;
        transform: translateX(-100%);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

.user-info {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.user-menu {
    position: relative;
    cursor: pointer;
    padding: 5px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
    transition: border-color 0.2s ease;
}

.user-avatar:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: 45px;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 255, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    min-width: 200px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1001;
    transition: opacity 0.2s ease;
}

.user-dropdown p {
    color: var(--pure-white);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Add invisible gap to maintain hover */
.user-dropdown::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
}

.user-menu:hover .user-avatar {
    border-color: var(--primary-green);
    transform: scale(1.05);
    transition: all 0.2s ease;
}

.logout-link {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 8px 0;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.logout-link:hover {
    color: var(--primary-green);
}

.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--primary-green);
}

.nav-links {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.nav-link {
    color: var(--pure-white);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-green);
}

/* Adjust main content for fixed nav */
body {
    padding-top: 70px;
}

.auth-container {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    margin: 2rem auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--pure-white);
}

.auth-description {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

.auth-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.logo-link {
    text-decoration: none;
    display: block;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.league-members {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.member-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.member-card.organizer {
    border-color: var(--primary-green);
    background: rgba(0, 255, 0, 0.05);
}

.member-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.member-info h3 {
    margin: 0;
    font-size: 1.1rem;
}

.member-role {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.invite-form {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--pure-white);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: var(--pure-white);
}

.invite-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary-green);
    color: var(--off-black);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.invites-link {
    display: block;
    color: var(--primary-green);
    text-decoration: none;
    padding: 8px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
    transition: color 0.2s ease;
}

.invites-link:hover {
    color: var(--dark-green);
}

.invites-container {
    max-width: 800px;
    margin: 2rem auto;
}

.invite-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.invite-content h3 {
    margin: 0 0 1rem 0;
    color: var(--pure-white);
}

.invite-details {
    display: flex;
    gap: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
}

.invite-message {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
}

.invite-expires {
    font-size: 0.9rem;
    color: var(--primary-green);
}

.invite-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.profile-container {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 12px;
    max-width: 600px;
    margin: 2rem auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.profile-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--pure-white);
}

.profile-description {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
}

.avatar-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.avatar-option input[type="radio"] {
    display: none;
}

.avatar-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.avatar-option input[type="radio"]:checked + label {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--primary-green);
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.league-details {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.league-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--pure-white);
    font-weight: 800;
    letter-spacing: -1px;
}

.league-info {
    margin-bottom: 2rem;
}

.league-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

.league-info .organizer {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.league-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.page-header h1 {
    font-size: 2.5rem;
    color: var(--pure-white);
    font-weight: 800;
    letter-spacing: -1px;
    margin: 0;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-actions .cta-button {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.leagues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.league-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s, background-color 0.2s;
}

.league-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.empty-state p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;  /* Add space between text and button */
}

.empty-state .cta-button {
    display: inline-block;
    margin-top: 0.5rem;  /* Additional top margin for the button */
}

.games-section {
    margin-bottom: 3rem;
}

.games-section h2 {
    font-size: 1.8rem;
    color: var(--pure-white);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.game-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s, background-color 0.2s;
    text-decoration: none;
    color: var(--pure-white);
}

.game-info-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.game-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.game-card.complete {
    opacity: 0.8;
}

.game-info {
    display: flex;
    gap: 1.5rem;
}

.game-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.game-date .date {
    font-size: 1.2rem;
    font-weight: 600;
}

.game-date .time {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.game-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.game-details p {
    color: rgba(255, 255, 255, 0.8);
}

.game-status .status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status.complete {
    background: rgba(0, 255, 0, 0.1);
    color: var(--primary-green);
}

.status.cancelled {
    background: rgba(255, 0, 0, 0.1);
    color: #ff4444;
}

.status.expired {
    background: rgba(255, 0, 0, 0.1);
    color: #ff4444;
}

.status.upcoming {
    background: rgba(255, 255, 255, 0.1);
    color: var(--pure-white);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.modal:target {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--off-black);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 500px;
    width: 100%;
}

.game-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

.pending-invites {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.invites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.invite-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.invite-date, .invite-expiry {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0.25rem 0;
}

.availability-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.availability-btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.availability-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.availability-btn.available {
    background: var(--color-success);
    color: white;
}

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

.availability-btn.available.selected {
    background: var(--color-success);
    border-color: var(--color-success);
}

.availability-btn.unavailable.selected {
    background: var(--color-danger);
    border-color: var(--color-danger);
}

.game-details-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
}

.game-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.game-header h2 {
    font-size: 2rem;
    margin: 0;
}

.game-header .time {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
}

.game-header .status {
    margin-left: auto;
}

.teams-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.team-column {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
}

.team-column h4 {
    text-align: center;
    margin-top: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.team-a {
    background: rgba(41, 128, 185, 0.2);
}

.team-b {
    background: rgba(231, 76, 60, 0.2);
}

.draggable {
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
}

.draggable:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.dragging {
    opacity: 0.7;
    cursor: grabbing;
}

.team-column {
    min-height: 150px;
}

.player-card {
    user-select: none; /* Prevents text selection during drag */
}

.player-card img, 
.player-card .player-info {
    pointer-events: none; /* Makes child elements non-draggable */
}

/* Game score styles */
.game-score-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.score-inputs {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.team-score {
    flex: 1;
    text-align: center;
}

.score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 1.5rem 0;
}

.score-divider {
    margin: 0 1.5rem;
}

.final-score .team-name {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.final-score .score {
    font-size: 3rem;
    font-weight: bold;
}
