/* General App Styles */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #10b981;
    --secondary-hover: #059669;
    --admin-color: #8b5cf6;
    --admin-hover: #7c3aed;
    --venue-color: #3b82f6;
    --venue-hover: #2563eb;
    --referee-color: #e11d48;
    --referee-hover: #be123c;
    --text-color: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --highlight-color: #f59e0b;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    background-image: url('../css/assets/images/pitch-background.svg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0; /* Removed gap since we're positioning elements manually */
    position: relative; /* For absolute positioning of children */
    min-height: 90vh; /* Ensure container has enough height */
}

/* Logo Section */
.app-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.centered-title {
    position: fixed; /* Changed to fixed to align with the fixed background */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Perfect centering */
    z-index: 1;
    margin-bottom: 0;
}

.app-logo img {
    width: auto;
    height: auto;
    max-width: 300px; /* Slightly reduced for better proportions */
}

.logo-svg {
    width: 100%;
    max-width: 300px;
}

/* Custom font styling for heading */
.gunplay-font {
    font-family: 'Gunplay', 'Poppins', sans-serif !important;
    font-weight: normal;
}

/* Removed tagline styling */

/* Login Section */
.login-section {
    width: 100%;
    text-align: center;
    position: fixed; /* Fixed positioning to work with the fixed title */
    bottom: 5vh; /* Position at the bottom with some margin */
    left: 0;
    right: 0;
    z-index: 2; /* Higher than the title to ensure it's clickable */
}

/* Login Options */
.login-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 6rem; /* Increased from 2rem to 6rem to move login sections further apart */
    margin: 0 auto;
    width: 100%;
    max-width: 900px; /* Increased from 800px to 900px to accommodate the wider gap */
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1), 
                box-shadow 0.3s cubic-bezier(0.19, 1, 0.22, 1), 
                opacity 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: transform, box-shadow; /* Optimize for animation */
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Add animation delay to stagger the cards appearance */
.login-options .login-card:nth-child(1) {
    transition-delay: 0.05s;
}

.login-options .login-card:nth-child(2) {
    transition-delay: 0.1s;
}

.login-card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--bg-light);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card-icon img {
    width: 48px;
    height: 48px;
    color: var(--text-primary);
}

.login-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.login-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Login Buttons */
.login-btn {
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    min-width: 220px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
}

.login-btn:last-child {
    margin-bottom: 0;
}

.login-btn:active {
    transform: translateY(1px);
}

.login-btn.admin {
    background-color: var(--admin-color);
    color: white;
}

.login-btn.admin:hover {
    background-color: var(--admin-hover);
}

.login-btn.venue {
    background-color: var(--venue-color);
    color: white;
}

.login-btn.venue:hover {
    background-color: var(--venue-hover);
}

.login-btn.referee {
    background-color: var(--referee-color);
    color: white;
}

.login-btn.referee:hover {
    background-color: var(--referee-hover);
}

/* Development Notice */
.development-notice {
    color: var(--text-light);
    font-size: 0.8rem;
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem 0;
    background-color: transparent;
    z-index: 10;
}

.development-notice p {
    margin: 0.2rem 0;
}

/* Login Form */
.login-form {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.98); /* Centered perfectly */
    opacity: 0; /* Start with opacity 0 */
    visibility: hidden; /* Hidden initially */
    display: none; /* Hidden by default, will be set to flex when active */
    flex-direction: column;
    gap: 1.2rem;
    align-items: center;
    background: var(--bg-card);
    padding: 2.5rem 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 100;
    min-width: 360px;
    max-width: 90%;
    transition: transform 0.35s cubic-bezier(0.19, 1, 0.22, 1), 
                opacity 0.35s cubic-bezier(0.19, 1, 0.22, 1), 
                visibility 0.35s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: none; /* Prevent interaction when hidden */
    backface-visibility: hidden; /* Prevent blurriness */
    -webkit-font-smoothing: antialiased; /* Improve text rendering */
    -moz-osx-font-smoothing: grayscale; /* Improve text rendering in Firefox */
}

/* Active state for the form */
.login-form.active {
    opacity: 1;
    visibility: visible;
    display: flex;
    transform: translate(-50%, -50%); /* Remove scale to avoid blurriness when visible */
    pointer-events: auto; /* Allow interaction when visible */
    /* Ensure crisp rendering in active state */
    backface-visibility: hidden;
    -webkit-transform: translate(-50%, -50%); /* Match the standard transform for consistency */
    -webkit-backface-visibility: hidden;
}

/* Form types */
.login-form.league-form {
    border-top: 4px solid var(--venue-color);
}

.login-form.referee-form {
    border-top: 4px solid #14532d; /* Updated to match the referee login button green color */
}

.login-form.captain-form {
    border-top: 4px solid var(--primary-color);
}

/* Form Icon */
.form-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Animation on form icons removed as requested */

.form-icon img {
    width: 40px;
    height: 40px;
}

/* Form fields */
.form-fields {
    width: 100%;
    margin-bottom: 1rem;
}

.form-field {
    margin-bottom: 1rem;
    text-align: left;
    width: 100%;
}

.form-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.login-form h2 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    color: var(--text-color);
    font-weight: 700;
    text-align: center;
    width: 100%;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
    letter-spacing: -0.01em;
}

.form-fields {
    width: 100%;
    margin-bottom: 0.5rem;
}

.form-field {
    margin-bottom: 1.2rem;
    width: 100%;
}

.form-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-color);
}

.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"] {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 1rem;
    margin-bottom: 0.3rem;
    box-sizing: border-box;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Ensure crisp rendering of text */
    text-rendering: optimizeLegibility;
}

.login-form input[type="text"]:focus,
.login-form input[type="email"]:focus,
.login-form input[type="password"]:focus {
    border-color: var(--primary-color);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 2px rgba(59, 130, 246, 0.15);
    outline: none;
    background-color: #f8fafc;
}

.form-error {
    background-color: #fee2e2;
    border-radius: var(--radius-sm);
    padding: 0.6rem;
    color: #b91c1c;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    width: 100%;
    text-align: center;
    font-weight: 500;
}

.login-btn.submit {
    background: var(--primary-color);
    color: #fff;
    margin-top: 1.25rem;
    width: 100%;
    padding: 1rem;
    font-weight: 600;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    letter-spacing: 0.02em;
}

.login-btn.submit:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.login-btn.submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.login-btn.cancel {
    background: #e2e8f0;
    color: var(--text-color);
    width: 100%;
    margin-top: 0.75rem;
    transition: all 0.25s ease;
    border-radius: var(--radius-md);
    font-weight: 500;
}

.login-btn.cancel:hover {
    background: #cbd5e1;
    transform: translateY(-1px);
}
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #222;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url('assets/images/pitch-background.svg') center center no-repeat;
    background-size: contain;
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}

header, main, .main-title {
    position: relative;
}

header {
    background: none;
    color: #222;
    text-align: center;
    margin-top: 0; /* Completely removed top margin */
    margin-bottom: 0; /* Removed bottom margin too */
}

main {
    min-height: 100vh;
    position: relative;
    margin-top: -2vh; /* Increased negative margin to pull content up more */
    padding-top: 1vh; /* Added small padding to prevent content from touching the top edge */
}

.login-options {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: row;
    gap: 20rem; /* Increased gap from 16rem to 20rem for more separation */
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s cubic-bezier(0.19, 1, 0.22, 1), 
                visibility 0.35s cubic-bezier(0.19, 1, 0.22, 1),
                transform 0.35s cubic-bezier(0.19, 1, 0.22, 1);
    /* Improve rendering quality */
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.login-options.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -48%); /* Only move slightly down, remove scale to prevent blur */
    pointer-events: none; /* Prevent interaction when hidden */
}

.login-btn {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 1rem 2.2rem;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    box-shadow: 0 2px 8px 0 rgba(30,41,59,0.06);
    outline: none;
    width: 260px;
    text-align: center;
    box-sizing: border-box;
    white-space: nowrap;
}
.login-btn.league {
    background: #2563eb;
    color: #fff;
}
.login-btn.league:hover {
    background: #1d4ed8;
    color: #fff;
    box-shadow: 0 4px 16px 0 rgba(37,99,235,0.13);
}
.login-btn.referee {
    background: #14532d;
    color: #fff;
}
.login-btn.referee:hover {
    background: #166534;
    color: #fff;
    box-shadow: 0 4px 16px 0 rgba(20,83,45,0.13);
}

/* Custom Notification System */
.notification-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.19, 1, 0.22, 1), 
                visibility 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    backdrop-filter: blur(3px);
    background-color: rgba(0, 0, 0, 0.3);
}

.notification-container.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.notification {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    display: none; /* Hide by default - only one will be shown at a time */
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    width: 400px;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1),
                opacity 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    text-align: center;
    position: relative; /* For absolute positioning of close button */
}

.notification-container.show .notification {
    transform: translateY(0);
    opacity: 1;
}

.notification-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.notification-icon img {
    width: 36px;
    height: 36px;
}

.notification-content {
    width: 100%;
}

.notification-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

.notification-content p {
    margin: 0;
    color: var(--text-light);
    font-size: 1rem;
}

.notification.success .notification-icon {
    background-color: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--secondary-color);
}

.notification.error .notification-icon {
    background-color: rgba(225, 29, 72, 0.1);
    border: 2px solid var(--referee-color);
}

.notification-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 18px;
    line-height: 1;
    color: var(--text-light);
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-color);
}

/* Test credentials display */
.test-credentials {
    margin-top: 0.75rem;
    text-align: center;
    color: var(--text-light);
    opacity: 0.8;
    font-style: italic;
    font-size: 0.85rem;
    padding: 0.75rem;
    background-color: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px dashed #cbd5e1;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .main-title {
        font-size: 2rem;
    }
    .subtitle {
        font-size: 1rem;
    }
    .login-options {
        display: flex;
        flex-direction: column;
        gap: 2rem; /* Reset to smaller gap on mobile */
        padding: 1.5rem 0.5rem;
        min-width: 0;
        max-width: 100%;
    }
    header {
        margin-top: 3vh;
    }
    
    .notification {
        width: 85%;
        padding: 1.2rem;
    }
}

/* Session Warning Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 450px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
    color: var(--text-light);
    line-height: 1.6;
}

.modal-body p {
    margin: 0 0 1rem;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-body strong {
    color: var(--primary-color);
    font-weight: 600;
}

.modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.modal-footer .login-btn {
    min-width: 100px;
    margin: 0;
}

@media (max-width: 600px) {
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .modal-footer {
        flex-direction: column-reverse;
    }
    
    .modal-footer .login-btn {
        width: 100%;
    }
}