/* Cinematic Welcome Page - Glassmorphism Masterpiece */

.cinematic-welcome-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('/static/images/login-hero.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    overflow: hidden;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

/* Heavy dark gradient overlay for text glow */
.cinematic-welcome-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(5, 10, 30, 0.88) 0%,
        rgba(0, 0, 0, 0.7) 50%,
        rgba(0, 0, 0, 0.6) 100%
    );
    z-index: 0;
}

/* Rain particles container */
.rain-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.rain-drop {
    position: absolute;
    top: -10%;
    width: 2px;
    height: 80px;
    background: linear-gradient(to bottom, transparent, rgba(160, 255, 200, 0.15), transparent);
    animation: rainfall 2s linear infinite;
    opacity: 0.4;
}

@keyframes rainfall {
    0% {
        top: -10%;
        opacity: 0;
    }
    10% {
        opacity: 0.4;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        top: 110%;
        opacity: 0;
    }
}

/* Centered glassmorphism card */
.glass-welcome-card {
    position: relative;
    z-index: 10;
    max-width: 480px;
    width: 90%;
    padding: 3rem 2.5rem;
    background: rgba(15, 20, 45, 0.45);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0, 255, 132, 0.3);
    border-radius: 24px;
    box-shadow: 
        0 8px 32px rgba(0, 255, 132, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: cardFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Droplet effect on glass card edges */
.glass-welcome-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 20%;
    width: 4px;
    height: 40px;
    background: linear-gradient(to bottom, transparent, rgba(160, 255, 200, 0.4), transparent);
    border-radius: 50%;
    animation: dropletSlide 4s ease-in-out infinite;
}

@keyframes dropletSlide {
    0%, 100% {
        top: 10%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        top: 90%;
    }
}

/* Welcome Header */
.welcome-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.welcome-logo {
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px rgba(0, 229, 196, 0.6));
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(0, 229, 196, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(0, 229, 196, 0.8));
    }
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #00FF84 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

.welcome-tagline {
    font-size: 1.125rem;
    color: #A0FFC8;
    font-weight: 400;
    opacity: 0.9;
}

/* Buttons Grid */
.welcome-buttons-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Cinematic Button Base */
.cinematic-button {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 1.5rem;
    background: rgba(25, 30, 55, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    cursor: pointer;
}

.cinematic-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 229, 196, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.cinematic-button:hover::before {
    opacity: 1;
}

/* Button hover lift effect */
.cinematic-button:hover {
    transform: scale(1.04) translateY(-4px);
}

/* Admin Button Specific */
.admin-button {
    border-color: rgba(0, 229, 196, 0.3);
}

.admin-button:hover {
    border-color: rgba(0, 229, 196, 0.6);
    box-shadow: 
        0 12px 40px rgba(0, 229, 196, 0.3),
        0 0 60px rgba(0, 255, 209, 0.2);
}

.admin-icon {
    animation: trophyFloat 3s ease-in-out infinite;
}

@keyframes trophyFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-8px) rotate(3deg);
    }
}

/* User Button Specific */
.user-button {
    border-color: rgba(255, 51, 102, 0.3);
}

.user-button:hover {
    border-color: rgba(255, 51, 102, 0.5);
    box-shadow: 
        0 12px 40px rgba(255, 51, 102, 0.25),
        0 0 60px rgba(0, 255, 209, 0.15);
}

.user-icon {
    animation: ballSpin 4s linear infinite;
}

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

/* Button Glow Effects */
.button-glow {
    position: absolute;
    inset: -2px;
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: -1;
}

.admin-glow {
    background: linear-gradient(135deg, #00FF84, #00FF84);
    filter: blur(20px);
}

.user-glow {
    background: linear-gradient(135deg, #FF3366, #00FF84);
    filter: blur(20px);
}

.cinematic-button:hover .button-glow {
    opacity: 0.4;
}

/* Button Content */
.button-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cinematic-button:hover .button-icon {
    transform: scale(1.1);
}

.button-content {
    text-align: center;
}

.button-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
    letter-spacing: -0.3px;
}

.button-subtitle {
    font-size: 0.875rem;
    color: #A0FFC8;
    opacity: 0.8;
    line-height: 1.4;
}

/* Stadium light beams on hover */
.cinematic-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(0, 229, 196, 0.1) 50%,
        transparent 70%
    );
    opacity: 0;
    transform: rotate(0deg);
    transition: all 0.6s ease;
}

.cinematic-button:hover::after {
    opacity: 1;
    transform: rotate(180deg);
}

/* Desktop: side-by-side buttons */
@media (min-width: 768px) {
    .glass-welcome-card {
        max-width: 560px;
        padding: 3.5rem 3rem;
    }

    .welcome-title {
        font-size: 2.75rem;
    }

    .welcome-buttons-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.75rem;
    }

    .cinematic-button {
        padding: 2.25rem 1.75rem;
    }
}

/* Mobile optimization */
@media (max-width: 767px) {
    .cinematic-welcome-page {
        background-position: 35% center;
    }

    .welcome-title {
        font-size: 2rem;
    }

    .glass-welcome-card {
        padding: 2.5rem 2rem;
    }

    .button-title {
        font-size: 1.125rem;
    }

    .button-subtitle {
        font-size: 0.8125rem;
    }
}

/* Performance optimization */
@media (prefers-reduced-motion: reduce) {
    .rain-drop,
    .welcome-logo,
    .admin-icon,
    .user-icon,
    .cinematic-button::after {
        animation: none;
    }

    .cinematic-button:hover {
        transform: none;
    }
}

/* Login Form Specific Styles */
.glass-login-form {
    max-width: 440px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #A0FFC8;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: #00FF84;
    gap: 0.75rem;
}

.error-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 51, 102, 0.15);
    border: 1px solid rgba(255, 51, 102, 0.4);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: #FF8AA7;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.error-message svg {
    flex-shrink: 0;
}

.success-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(57, 255, 20, 0.15);
    border: 1px solid rgba(57, 255, 20, 0.4);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: #39FF14;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    animation: successFadeIn 0.4s ease;
}

.success-message svg {
    flex-shrink: 0;
}

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

.forgot-password-link {
    margin-top: 0.75rem;
    text-align: right;
}

.forgot-password-link a {
    color: rgba(57, 255, 20, 0.8);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.forgot-password-link a:hover {
    color: #39FF14;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
}

.cinematic-form {
    margin-top: 2rem;
}

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

.form-group label {
    display: block;
    color: #A0FFC8;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: #00FF84;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: rgba(25, 30, 55, 0.6);
    border: 1px solid rgba(0, 255, 132, 0.3);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-wrapper input::placeholder {
    color: rgba(160, 255, 200, 0.4);
}

.input-wrapper input:focus {
    outline: none;
    border-color: #00FF84;
    background: rgba(25, 30, 55, 0.8);
    box-shadow: 0 0 0 3px rgba(0, 229, 196, 0.1);
}

.submit-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.125rem 2rem;
    background: linear-gradient(135deg, #00FF84, #00FF84);
    border: none;
    border-radius: 12px;
    color: #000;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-top: 2rem;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 229, 196, 0.4);
}

.submit-button:active {
    transform: translateY(0);
}

.user-submit {
    background: linear-gradient(135deg, #FF3366, #00FF84);
}

.user-submit:hover {
    box-shadow: 0 8px 24px rgba(255, 51, 102, 0.4);
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.form-footer p {
    color: #A0FFC8;
    font-size: 0.9rem;
}

.form-footer a {
    color: #00FF84;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.form-footer a:hover {
    color: #00FF84;
}

/* Developer Access Portal Button (DEV_MODE only) */
.dev-access-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 152, 0, 0.15));
    border: 2px solid rgba(255, 193, 7, 0.5);
    border-radius: 12px;
    color: #FFC107;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dev-access-button:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.25), rgba(255, 152, 0, 0.25));
    border-color: rgba(255, 193, 7, 0.8);
    box-shadow: 0 4px 20px rgba(255, 193, 7, 0.3);
    transform: translateY(-2px);
}

.dev-access-button:active {
    transform: translateY(0);
}

.dev-icon {
    font-size: 1.25rem;
    animation: devPulse 2s ease-in-out infinite;
}

@keyframes devPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.dev-text {
    letter-spacing: 0.5px;
}

/* Password Toggle and Form Options */
.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #00FF84;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    cursor: pointer;
    position: relative;
    padding-left: 28px;
}

.remember-me input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    height: 18px;
    width: 18px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.remember-me:hover .checkmark {
    border-color: rgba(0, 255, 132, 0.5);
}

.remember-me input:checked ~ .checkmark {
    background: linear-gradient(135deg, #00FF84, #00CC6A);
    border-color: #00FF84;
}

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

.remember-me input:checked ~ .checkmark:after {
    display: block;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-link {
    color: #A0FFC8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #00FF84;
}

/* Single Button Layout */
.welcome-buttons-single {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cinematic-button.full-width {
    width: 100%;
}

.welcome-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.welcome-footer p {
    color: rgba(160, 255, 200, 0.8);
    font-size: 0.95rem;
}

.signup-link {
    color: #00FF84;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.signup-link:hover {
    color: #39FF14;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
}

/* Admin Portal Styling */
.admin-portal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-portal-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 255, 132, 0.1);
    border: 1px solid rgba(0, 255, 132, 0.3);
    border-radius: 20px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    color: #00FF84;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Two-button layout for Sign In / Sign Up */
.welcome-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.welcome-buttons .cinematic-button {
    padding: 1.5rem 1rem;
}

.signup-button {
    border-color: rgba(57, 255, 20, 0.3);
}

.signup-button:hover {
    border-color: rgba(57, 255, 20, 0.6);
    box-shadow: 
        0 12px 40px rgba(57, 255, 20, 0.3),
        0 0 60px rgba(57, 255, 20, 0.2);
}

.signup-glow {
    background: radial-gradient(circle, rgba(57, 255, 20, 0.4) 0%, transparent 70%);
}

.signup-icon {
    animation: userBounce 2s ease-in-out infinite;
}

@keyframes userBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@media (max-width: 480px) {
    .welcome-buttons {
        grid-template-columns: 1fr;
    }
}
