/* =========================================
   LANDING PAGE OVERLAY (ENTRY SCREEN)
   ========================================= */

#landing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: transparent;
    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;
}

/* عند عرض الصفحة الرئيسية يُجبَر إظهار الـ overlay حتى مع وجود ستايل مخفي من سكربت سابق */
body.landing-active #landing-overlay {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* 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.85);
    /* Modern white glassmorphism */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    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);
    /* very light shadow */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Hover effect handled in prescription.css */

.l-card i {
    font-size: 3rem;
    color: #475569;
    /* Slate 600 */
    transition: 0.3s;
}

.l-card h3 {
    font-size: 1.2rem;
    color: #1e293b;
    /* Slate 800 */
    margin: 0;
    transition: 0.3s;
}

.l-card p {
    font-size: 0.9rem;
    color: #64748b;
    /* Slate 500 */
    margin: 0;
    font-weight: 500;
}

.l-card:hover i,
.l-card:hover h3 {
    color: #0d6efd;
}

.l-card:hover i {
    transform: scale(1.1);
}

/* 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: #0d6efd;
    text-shadow: 0 4px 10px rgba(13, 110, 253, 0.1);
}

body.dark-mode .landing-subtitle {
    color: #94a3b8;
}

body.dark-mode .landing-toggle {
    background: rgba(30, 41, 59, 0.8);
    color: #fff;
}

body.dark-mode .l-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.5) 100%), radial-gradient(circle at top right, rgba(56, 189, 248, 0.15) 0%, transparent 60%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Dark hover in prescription.css */

body.dark-mode .l-card i {
    color: #cbd5e1;
}

body.dark-mode .l-card h3 {
    color: #e2e8f0;
}

body.dark-mode .l-card p {
    color: #94a3b8;
}

body.dark-mode .l-card:hover i,
body.dark-mode .l-card:hover h3 {
    color: #38bdf8;
}

.landing-footer {
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
    color: #94a3b8 !important;
}

.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-overlay {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        padding: 30px 0 !important;
        box-sizing: border-box !important;
    }

    .landing-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 15px !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .landing-cards {
        grid-template-columns: repeat(2, 1fr) !important;
        max-width: 100% !important;
        width: 100% !important;
        gap: 15px;
        padding: 0 10px !important;
        box-sizing: border-box !important;
    }

    .l-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 12px 10px;
        min-height: 120px;
        justify-content: center;
        gap: 8px;
    }

    .landing-title-main {
        font-size: 1.6rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        padding: 0 10px;
    }

    .landing-subtitle {
        font-size: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        padding: 0 10px;
        margin-bottom: 30px;
    }

    .l-card i {
        font-size: 2.2rem;
    }

    .l-card h3 {
        font-size: 1.1rem;
    }

    .l-card p {
        font-size: 0.85rem;
    }
}

@media screen and (max-width: 480px) {
    .landing-cards {
        grid-template-columns: 1fr !important;
    }

    .landing-title-main {
        font-size: 1.4rem;
    }
}

/* Colored Icons */
.l-card i.icofont-chart-bar-graph {
    color: #f59e0b !important;
}

.l-card i.icofont-stethoscope-alt {
    color: #10b981 !important;
}

.l-card i.icofont-prescription {
    color: #3b82f6 !important;
}

.l-card i.icofont-file-text {
    color: #a855f7 !important;
}

.l-card i.icofont-users-alt-5 {
    color: #ec4899 !important;
}

.l-card i.icofont-calendar {
    color: #06b6d4 !important;
}

.l-card i.icofont-folder-open {
    color: #14b8a6 !important;
}

.l-card i.icofont-laboratory {
    color: #ef4444 !important;
}

.l-card i.icofont-first-aid {
    color: #f43f5e !important;
}

.l-card i.icofont-hospital {
    color: #8b5cf6 !important;
}

.l-card i.icofont-users-social {
    color: #6366f1 !important;
}

.l-card i.icofont-money-bag {
    color: #84cc16 !important;
}

.l-card i.icofont-dashboard-web {
    color: #64748b !important;
}

.l-card i.icofont-web {
    color: #0ea5e9 !important;
}

.l-card i.icofont-home {
    color: #10b981 !important;
}

@media screen and (max-width: 1400px) {
    .landing-cards {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media screen and (max-width: 768px) {
    .landing-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .landing-title-main {
        font-size: 2rem;
    }
}

@media screen and (max-width: 480px) {
    .landing-cards {
        grid-template-columns: 1fr !important;
    }

    .landing-title-main {
        font-size: 1.4rem;
    }
}