/* =========================================
   LANDING PAGE OVERLAY (ENTRY SCREEN)
   ========================================= */

#landing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent;
    /* Changed from solid color */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 50px 0;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* HIDE APP CONTENT WHEN LANDING IS ACTIVE */
body.landing-active .app-container,
body.landing-active .sidebar,
body.landing-active .mobile-app-header,
body.landing-active .action-bar,
body.landing-active .top-toolbar {
    display: none !important;
}

#landing-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Apply background to body when landing is active */
body.landing-active {
    background: #ffffff;
}

body.landing-active.dark-mode {
    background: #0f172a;
}

/* Background Canvas */
#landing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Content Wrapper */
.landing-content {
    position: relative;
    z-index: 10;
    text-align: center;
    width: 100%;
    max-width: 1300px;
    padding: 20px;
    margin: auto;
    /* Centers correctly now */
}

/* Titles */
.landing-title-main {
    font-size: 3rem;
    font-weight: 900;
    color: #0d6efd;
    margin-bottom: 10px;
    letter-spacing: -1px;
    text-shadow: 0 4px 10px rgba(13, 110, 253, 0.1);
    animation: fadeInUp 0.8s ease-out;
}

.landing-subtitle {
    font-size: 1.5rem;
    color: #6c757d;
    margin-bottom: 50px;
    font-weight: 600;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

/* Cards Grid */
.landing-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    justify-content: center;
    gap: 20px;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

/* Individual Card */
.l-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 25px 15px;
    width: 100%;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.l-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 40px rgba(13, 110, 253, 0.2);
    border-color: #0d6efd;
    background: rgba(255, 255, 255, 0.9);
}

.l-card i {
    font-size: 3rem;
    color: #444;
    transition: 0.3s;
}

.l-card h3 {
    font-size: 1.2rem;
    color: #333;
    margin: 0;
    transition: 0.3s;
}

.l-card p {
    font-size: 0.9rem;
    color: #777;
    margin: 0;
    font-weight: 500;
}

.l-card:hover i {
    color: #0d6efd;
    transform: scale(1.1);
}

.l-card:hover h3 {
    color: #0d6efd;
}

/* Dark Mode Toggle (Floating) */
.landing-toggle {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 20;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 14px;
    transition: 0.3s;
}

.landing-toggle:hover {
    transform: scale(1.05);
}

/* LIGHT MODE STYLES (DEFAULT) */
.landing-toggle {
    background: rgba(255, 255, 255, 0.8);
    color: #333;
}

/* DARK MODE STYLES (APPLIED WHEN BODY HAS .dark-mode) */
/* body.dark-mode #landing-overlay { background: #0f172a; } -> Moved to body rule */

body.dark-mode .landing-title-main {
    color: #38bdf8;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

body.dark-mode .landing-subtitle {
    color: #94a3b8;
}

body.dark-mode .l-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body.dark-mode .l-card:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: #38bdf8;
    box-shadow: 0 20px 40px rgba(56, 189, 248, 0.2);
}

body.dark-mode .l-card i {
    color: #cbd5e1;
}

body.dark-mode .l-card h3 {
    color: #e2e8f0;
}

body.dark-mode .l-card:hover i,
body.dark-mode .l-card:hover h3 {
    color: #38bdf8;
}

body.dark-mode .landing-toggle {
    background: rgba(30, 41, 59, 0.8);
    color: #fff;
}

.landing-footer {
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

body.dark-mode .landing-footer {
    color: #94a3b8 !important;
    /* Lighter gray for dark mode */
}

body.dark-mode .landing-footer a:hover {
    color: #fff !important;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Adjustments for Landing Cards */
@media screen and (max-width: 1300px) {
    .landing-cards {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1000px;
        margin: 0 auto;
    }
}

@media screen and (max-width: 992px) {
    .landing-cards {
        grid-template-columns: repeat(3, 1fr);
        max-width: 750px;
    }

    .landing-title-main {
        font-size: 2.2rem;
    }
}

@media screen and (max-width: 768px) {
    .landing-cards {
        grid-template-columns: repeat(2, 1fr);
        max-width: 500px;
        gap: 15px;
    }

    .landing-title-main {
        font-size: 1.8rem;
    }

    .landing-subtitle {
        font-size: 1.1rem;
    }

    .l-card {
        padding: 20px 10px;
    }

    .l-card i {
        font-size: 2.2rem;
    }
}

@media screen and (max-width: 480px) {
    .landing-cards {
        grid-template-columns: 1fr;
        max-width: 280px;
    }
}