@import url('google-fonts.css');

:root {
    --brand-red: #3A86C4;
    --brand-red-dark: #2D6999;
    --oil-gold: #f1c40f;

    /* Ultra Transparent Glass (Dark Theme) */
    --glass-bg: rgba(0, 0, 0, 0.2);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-color: #fff;
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-text: #333;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100vw;
    /* Dark Background - Fallback color while JS loads the dynamic image from DB */
    background: #1a1a2e no-repeat center center fixed;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Illustration Background Layer (For animated palms) */
.illustration-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Animated Palms Positioning - Darker to blend */
.palm-tree {
    position: absolute;
    bottom: -20px;
    z-index: 0;
    width: 350px;
    height: auto;
    filter: brightness(0.6);
    /* Darken SVGs to match night theme */
}

.palm-left {
    left: -80px;
    transform: scale(1.3);
}

.palm-right {
    right: -80px;
    transform: scale(1.2) scaleX(-1);
}

.palm-center-left {
    left: 15%;
    bottom: 5%;
    transform: scale(0.9);
    opacity: 0.8;
}

.palm-center-right {
    right: 15%;
    bottom: 5%;
    transform: scale(1.0) scaleX(-1);
    opacity: 0.8;
}

/* Particle Container - ON TOP OF EVERYTHING */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

.oil-drop {
    width: 4px;
    height: 8px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), var(--oil-gold));
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(241, 196, 15, 0.4);
}

@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.6;
        transform: translateY(90vh) rotate(360deg);
    }

    100% {
        transform: translateY(92vh) rotate(380deg);
        opacity: 0;
    }
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 450px;
    padding: 80px 20px 20px 20px;
    z-index: 10;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-card {
    width: 100%;
    background: var(--glass-bg);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    overflow: visible;
    padding: 25px 30px 40px 30px;
    position: relative;
    transition: all 0.3s ease;
}

/* Logo Styling */
.logo-container {
    text-align: center;
    margin-bottom: 15px; /* Reduced gap */
    padding-top: 0;
    perspective: 1000px;
    position: relative;
    z-index: 20;
}

/* Floating effect only when logo is inside the card */
.login-card .logo-container {
    margin-top: -55px;
}

.logo-img {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.5));
    user-select: none;
    background: transparent;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 30px;
    padding: 5px;
    width: 100%;
}

.toggle-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.toggle-btn.active {
    color: #fff;
    background: var(--brand-red);
    box-shadow: 0 4px 10px rgba(58, 134, 196, 0.4);
}

.toggle-btn:hover:not(.active) {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Forms */
.form-section {
    display: none;
    animation: fadeIn 0.5s ease;
    width: 100%;
}

.form-section.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    text-align: center;
    margin-bottom: 25px;
}

.section-header h2 {
    color: #fff;
    font-weight: 700;
    font-size: 1.4rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.section-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 400;
}

/* Inputs */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-control-custom {
    width: 100%;
    padding: 14px 15px;
    padding-left: 45px;
    background: var(--input-bg);
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 1rem;
    color: var(--input-text);
    transition: all 0.3s ease;
}

.form-control-custom:focus {
    outline: none;
    background: #fff;
    border-color: var(--brand-red);
    box-shadow: 0 0 15px rgba(58, 134, 196, 0.3);
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--brand-red);
    font-size: 1.1rem;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #666;
}

.toggle-password:hover {
    color: var(--brand-red);
}

/* Buttons */
.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin-top: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.footer-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 25px;
    font-size: 0.85rem;
}

/* --- New Effects Styles --- */

/* Particle Wrapper (Base for all effects) */
.particle-wrapper {
    position: absolute;
    top: -100px;
    animation-iteration-count: infinite;
    z-index: 1;
}

.particle-wrapper.fall {
    animation-name: fall;
    animation-timing-function: linear;
}

.particle-wrapper.bee-fly {
    animation-name: wander;
    animation-timing-function: ease-in-out;
}

#particles-container {
    z-index: 5;
    /* Higher than background but lower than ornaments if needed */
}

/* Designed Pine Garland */
.garland-container,
.card-garland {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(0, 0, 0, 0.0);
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.0);
    /* Pine Needle Texture */
    border-bottom: 3px rgba(0, 0, 0, 0.0);
    /* Subtle gold string */
}

.card-garland {
    position: absolute;
    top: 0;
    border-radius: 24px 24px 0 0;
    height: 40px;
    z-index: 5;
}

.bee {
    animation: beeFly 0.3s ease-in-out infinite alternate;
    position: relative;
    z-index: 2;
}

.effect-img {
    width: 35px;
    height: auto;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.2));
    display: block;
    opacity: 0.8;
}

@keyframes beeFly {
    0% {
        transform: translateX(-2px) rotate(-5deg);
    }

    100% {
        transform: translateX(2px) rotate(5deg);
    }
}

@keyframes wander {
    0% {
        transform: translate(0, -10vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    25% {
        transform: translate(15vw, 20vh) rotate(20deg);
    }

    50% {
        transform: translate(-10vw, 50vh) rotate(-15deg);
    }

    75% {
        transform: translate(20vw, 80vh) rotate(10deg);
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translate(0, 110vh) rotate(0deg);
        opacity: 0;
    }
}

/* Hexagons (Honeycombs) */
.hexagon {
    position: relative;
    opacity: 0.4;
    display: inline-block;
    animation: rotate 8s linear infinite;
}

/* Legacy clean up */
.oil-drop,
.leaf,
.hexagon::before,
.hexagon::after {
    display: none;
}

/* Snowflakes */
.snowflake {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

/* Crystal Pine Garland (Ultra-transparent) */
.garland-container {
    position: fixed;
    top: -100px;
    /* Hidden top part to show the lush branches */
    left: 0;
    width: 100%;
    height: 200px;
    background-image: url('../img/efectos/christmas_garland.png');
    background-repeat: repeat-x;
    background-size: auto 140%;
    background-position: center 25%;
    z-index: 9999;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 1.0;
    filter: contrast(1.5) brightness(1.3) saturate(1.1);
}

/* Christmas Lights (Twinkling dots) */
.light-bulb {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    opacity: 0.9;
    animation-name: blink;
    animation-duration: 1s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    box-shadow: 0 0 8px currentColor;
}

@keyframes sway {
    0% {
        transform: rotate(-15deg);
    }

    100% {
        transform: rotate(15deg);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Rain */
.rain-drop {
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(100, 149, 237, 0.8));
    opacity: 0.6;
}

/* --- Weather Sync Styles --- */
.lightning-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
}

.lightning-overlay.flash-active {
    opacity: 0.7;
}

.sun-glow {
    position: fixed;
    top: -150px;
    right: -150px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0) 70%);
    pointer-events: none;
    z-index: 0;
    animation: sunPulse 8s ease-in-out infinite alternate;
}

@keyframes sunPulse {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }

    100% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

/* Glassmorphism Modals */
.modal-glass {
    background: rgba(255, 255, 255, 0.15) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    backdrop-filter: blur(20px) !important;
    border-radius: 24px !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3) !important;
    color: white !important;
}

.modal-glass-header {
    border-color: rgba(255, 255, 255, 0.1) !important;
    display: block !important;
    text-align: center;
}

.modal-glass-title {
    color: #fff;
    font-size: 1.4rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.input-glass-bg {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #333 !important;
    border-radius: 12px !important;
    border: none !important;
    padding-left: 45px !important;
}

.input-glass-icon {
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    z-index: 5;
}

.textarea-glass-fix {
    padding-top: 15px !important;
}

.textarea-glass-icon {
    top: 20px !important;
    transform: none !important;
}

.btn-glass-gradient {
    background: linear-gradient(135deg, #3A86C4, #2D6999) !important;
    color: white !important;
    border: none !important;
    padding: 12px !important;
}

/* Stars for Night Effect */
.star {
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.8);
    animation: twinkle 3s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% {
        opacity: 0.4;
        transform: scale(0.7);
    }

    100% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Smoke/Clouds for Cloudy Effect */
.cloud {
    width: 450px;
    height: 250px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 80%);
    border-radius: 50%;
    filter: blur(60px);
}

.particle-wrapper.float-slow {
    animation-name: floatSlow;
    animation-timing-function: ease-in-out;
}

@keyframes floatSlow {
    0% {
        transform: translate(-30vw, 20vh);
        opacity: 0;
    }

    20% {
        opacity: 0.6;
    }

    80% {
        opacity: 0.6;
    }

    100% {
        transform: translate(120vw, -10vh);
        opacity: 0;
    }
}

.night-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 10, 50, 0.5), rgba(0, 0, 0, 0));
    pointer-events: none;
    z-index: 0;
}

.cloudy-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(120, 120, 140, 0.5), rgba(0, 0, 0, 0));
    pointer-events: none;
    z-index: 0;
}

/* Brighter stars for night mode */
.night-overlay+#particles-container .snowflake {
    box-shadow: 0 0 8px #fff, 0 0 15px rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.sun-glow {
    position: fixed;
    top: -200px;
    right: -200px;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, rgba(255, 215, 0, 0) 70%);
    pointer-events: none;
    z-index: 0;
    animation: sunPulse 8s ease-in-out infinite alternate;
}

@keyframes sunPulse {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }

    100% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

/* Custom SweetAlert2 Premium Styles */
.swal2-premium-glass {
    background: rgba(15, 23, 42, 0.85) !important; /* Elegant dark navy glass */
    -webkit-backdrop-filter: blur(16px) !important;
    backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 24px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7) !important;
    color: #f8fafc !important;
    font-family: 'Poppins', sans-serif !important;
}

.swal2-premium-title {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1.5rem !important;
    letter-spacing: -0.5px;
    margin-top: 15px !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.swal2-premium-html {
    color: #e2e8f0 !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
}

.swal2-premium-confirm {
    background: linear-gradient(135deg, #3A86C4, #2D6999) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 12px 28px !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(58, 134, 196, 0.4) !important;
    cursor: pointer;
    margin: 0 8px !important;
}

.swal2-premium-confirm:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(58, 134, 196, 0.6) !important;
}

.swal2-premium-cancel {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    padding: 12px 28px !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
    margin: 0 8px !important;
}

.swal2-premium-cancel:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

/* Glass Details Card for Active Session Details */
.swal-session-details {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 18px;
    margin-top: 18px;
    margin-bottom: 22px;
    text-align: left;
}

.swal-session-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.swal-session-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.swal-session-label {
    color: #94a3b8;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.swal-session-value {
    color: #ffffff;
    font-weight: 600;
}

/* Pulsing and glowing reload button state */
.btn-reload-state {
    background: linear-gradient(135deg, #f1c40f, #d68910) !important; /* Sleek amber/gold gradient */
    color: #1a1a2e !important;
    font-weight: 700 !important;
    animation: pulseGlow 1.5s infinite alternate !important;
    border: none !important;
}

.btn-reload-state:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 0 25px rgba(241, 196, 15, 0.8) !important;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 12px rgba(241, 196, 15, 0.4);
    }
    100% {
        box-shadow: 0 0 24px rgba(241, 196, 15, 0.8);
    }
}