/* ==========================================================================
   RESET & GLOBAL OPTIMIZATION
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html,
body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
    background-color: #909aab; 
}

:root{
    --accent:#d6ef29;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    background: linear-gradient(to right, #b2b9c0 0%, #909aab 100%);
}

/* Master Wrapper Container */
.app-container {
    width: 100%;
    max-width: 960px;
    text-align: center;
    margin: auto;
    z-index: 2; 
}

/* ==========================================================================
   3D EXTENDED HEADER WITH SHARP BLACK SHADOWS (MOBILE-OPTIMIZED)
   ========================================================================== */
.portal-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    line-height: 1.05;
    /* padding-top: 2em; */
    padding-bottom: 2.5rem;
}

/* Premium 3D Metallic Chrome Brand Header */
.nexams-logo {
  
    font-family: 'Arial Black', sans-serif;
    font-size: clamp(4rem, 5vw, 7rem);
    font-weight: 900;
    letter-spacing: 4px;
    margin: 0;
    line-height: 1;

    /* Metallic white gradient */
    background: linear-gradient(
          to bottom,
          #ffffff 0%,
          #f5f5f5 20%,
          #dadada 60%,
          #a6a6a6 100%
      );

    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;

    /* 3D extrusion */
    text-shadow:
         0 1px 0 #fff,
      0 2px 0 #eee,
      0 3px 0 #ddd,
      0 4px 0 #ccc,
      0 8px 15px rgba(0,0,0,.2),
      0 14px 25px rgba(0,0,0,.18);

    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.18));
    animation: nexamsBounce 1.5s ease-out, silverShine 5s linear infinite;
    /* transform-style:preserve-3d; */
}

/* Radiant Glowing Neon Highlight "X" */
/* Green X */
.x-letter {
    background: linear-gradient(
        180deg,
        #cddb32 0%,
        #acbf20 20%,
        #9db021 45%,
        #91a730 70%,
        #6b7e10 100%
    );

    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;

    /* 3D Extrusion */
    text-shadow:
        0 1px 0 #cddb32,
        0 2px 0 #acbf20,
        0 3px 0 #9db021,
        0 4px 0 #91a730,
        0 5px 0 #6b7e10,

        /* Dark shadow underneath */
        0 8px 8px rgba(0,0,0,.18),
        0 12px 18px rgba(0,0,0,.22),

        /* Glow */
        0 0 8px rgba(214,239,41,.35),
        0 0 15px rgba(214,239,41,.25);

    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.18));
    animation: xShine 2s ease-in-out infinite;
    animation-delay: 1.6s;
}

@keyframes nexamsBounce {
    0% { transform: translateY(-100px) scale(.3); opacity: 0; }
    55% { transform: translateY(15px) scale(1.12); opacity: 1; }
    75% { transform: translateY(-8px) scale(.97); }
    90% { transform: translateY(4px) scale(1.02); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes xShine {
  0%, 100% {
    text-shadow:
      0 0 5px #a8c808,
      0 0 10px #a8c808;
  }
  50% {
    text-shadow:
      0 0 10px #fff,
      0 0 20px #889b29,
      0 0 35px #a8c808,
      0 0 50px #fff;
  }
}



/* Sub-branding Module */
.portal-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: clamp(1.6rem, 5vw, 2rem);
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.text-employee {
    color: #1e293b !important; 
    -webkit-text-fill-color: #1e293b !important;
    font-weight: 700 !important;
    background: none !important;
    text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.8), 0px 2px 3px rgba(0, 0, 0, 0.15);
}

.text-portal {
    color: #d6ef29 !important; 
    -webkit-text-fill-color: #d6ef29 !important;
    font-weight: 700 !important;
    background: none !important;
    text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.25);
    filter: drop-shadow(0px 0px 8px rgba(43, 46, 29, 0.8));
}

.portal-text::before,
.portal-text::after {
    content: "—";
    color: #d6ef29;
    font-weight: bold;
    opacity: 0.8;
    padding: 0 8px;
    filter: drop-shadow(0px 0px 5px rgba(192, 223, 58, 0.8));
}

/* ==========================================================================
   PREMIUM NEUMORPHIC GRID INTERFACE
   ========================================================================== */
.button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 20px; 
    width: 100%;
    padding: 10px;
    max-width: 700px;   /* reduce overall grid width */
    margin: 0 auto;
}

/* Brilliant White Gloss Cards with Dynamic Halo Shadow */
.menu-btn {
    position: relative;
   background: linear-gradient(
        to bottom,
        rgba(255,255,255,.95),
        rgba(194, 199, 203, 0.98)
    );
    border:1px solid rgba(255,255,255,.95);
    border-radius:25px 0px 25px 0px!important; 
    padding: 24px 26px;
    box-shadow:
      inset 2px 2px 0 rgba(255,255,255,.9),
        inset -2px -2px 0 rgba(200,205,215,.35),
        0 15px 35px rgba(0,0,0,.12),
        0 0 30px rgba(214,239,41,.18);;
    /* transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1); */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    width: 80%;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    min-height: 120px;
    padding: 18px 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: floatGlow 3s ease-in-out infinite;
}

@keyframes floatGlow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
.btn-expense { animation: topLeft 1s ease-out; }
.btn-ot { animation: topRight 1s ease-out; }
.btn-leave { animation: centerLeft 1s ease-out; }
.btn-project { animation: centerRight 1s ease-out; }
.btn-advance:nth-of-type(5) { animation: bottomLeft 1s ease-out; }
.btn-advance:nth-of-type(6) { animation: bottomRight 1s ease-out; }

@keyframes topLeft {
    from { opacity: 0; transform: translate(-150px, -150px) scale(.7); }
    to { opacity: 1; transform: translate(0, 0) scale(1); }
}
@keyframes topRight {
    from { opacity: 0; transform: translate(150px, -150px) scale(.7); }
    to { opacity: 1; transform: translate(0, 0) scale(1); }
}
@keyframes centerLeft {
    from { opacity: 0; transform: translateX(-200px) scale(.7); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes centerRight {
    from { opacity: 0; transform: translateX(200px) scale(.7); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes bottomLeft {
    from { opacity: 0; transform: translate(-150px, 150px) scale(.7); }
    to { opacity: 1; transform: translate(0, 0) scale(1); }
}
@keyframes bottomRight {
    from { opacity: 0; transform: translate(150px, 150px) scale(.7); }
    to { opacity: 1; transform: translate(0, 0) scale(1); }
}

.menu-btn::before {
    content: "";
    position: absolute;
    left: 0;
    top: 22%;
    height: 60%;
    width: 4px;
    background:#a8c808;
    border-radius:8px;
    box-shadow:
      0 0 12px #a8c808,
      0 0 24px rgba(214,239,41,.6);
}

.menu-btn::after {
    content: " ";
    white-space: pre;
    position: absolute;
    top: 18px;
    right: 20px;
    color: #cbd5e1;
    font-size: 10px;
    letter-spacing: 4px;
    line-height: 1.1;
    opacity: 0.6;
    width:22px;
    height:22px;
    background:
      radial-gradient(circle,#cfd4db 2px,transparent 2px);
    background-size:8px 8px;
}

.menu-btn:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 45px rgba(0,0,0,.15),
      0 0 40px rgba(214,239,41,.4) !important;
}

.menu-btn:active {
    transform: scale(0.97);
}

/* Inset Icon Frame */
.btn-icon {
    background:radial-gradient(
    circle at center,
    #ffffff 0%,
    #f8fafc 35%,
    #edf1f5 65%,
    #d7dde5 100%
);
    width:70px;
    height:70px;
    min-width:70px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius:24px;
    box-shadow:
      15px 15px 30px rgba(0,0,0,.08),
      -10px -10px 25px rgba(225, 224, 224, 0.95);
}

.btn-icon i {
    font-size: 28px;
    color: #a8c808;
    filter: drop-shadow(0px 0px 6px rgba(214, 239, 41, 0.5));
   
}

.fa-clock {
     animation: orbitSpin 4s ease-in-out infinite;
}

.fa-hand-holding-dollar {
    animation: dynamicFloat 3s infinite ease-in-out;
}

.fa-calendar-check
 {
    animation: stampEffect 1.5s infinite;
 }

 .fa-chart-line {
  display: inline-block;
  transform-origin: bottom left;
  animation: chartGrow 2s ease-in-out infinite;
}

.fa-user-shield{
     animation: shieldLock 2s infinite;
}

.fa-screwdriver-wrench {
  animation: orbitSpin 4s ease-in-out infinite;
}



@keyframes orbitSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes dynamicFloat {
      0%, 100% { transform: translateY(0) rotate(0deg); }
      50% { transform: translateY(-6px) rotate(5deg); }
    }

@keyframes stampEffect {
  0%, 85%, 100% {
    transform: scale(1);
  }
  90% {
    transform: scale(1.5);
  }
  95% {
    transform: scale(0.95);
  }
}

@keyframes chartGrow {
  0%, 100% {
    transform: scaleY(0.8);
  }
  50% {
    transform: scaleY(1.15);
  }
}

@keyframes shieldLock {
  0%,100% {
    transform: translateY(0);
    filter: drop-shadow(0 0 0 rgba(255,255,255,0));
  }
  50% {
    transform: translateY(-3px);
    filter:
      drop-shadow(0 0 8px rgba(255,255,255,.6))
      drop-shadow(0 0 15px rgba(255,255,255,.3));
  }
}

.btn-text-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    line-height: 1.25;
}

.btn-text-content .txt-gray {
    font-size: 19px;
    font-weight: 700;
    color: #1e293b; 
}

.btn-text-content .txt-green {
    font-size: 19px;
    font-weight: 700;
    color: #a8c808; 
    filter: drop-shadow(0px 0px 6px rgba(203, 231, 19, 0.735));
}

.btn-text-content::after {
    content: "";
    display: block;
    width: 24px;
    height: 3.5px;
    background-color: #a8c808;
    border-radius: 2px;
    margin-top: 8px;
    box-shadow: 0px 0px 5px rgba(192, 223, 58, 0.6);
}

/* ==========================================================================
   CIRCUIT BG CANVAS LAYOUT
   ========================================================================== */
.circuit-bg {
    position: fixed;
    top: 0;
    right: 0;
    width: 50%; 
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

#circuitCanvas {
    width: 100%;
    height: 100%;
    display: block;
    filter: brightness(1.25) contrast(1.1);
}

/* ==========================================================================
   VIEWPORT COMPONENT ENGINE
   ========================================================================== */
#fullscreen-viewport {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    z-index: 9999;
    flex-direction: column;
    overflow: hidden;
}

.back-navigation-bar {
    width: 100%;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 10005;
}

.back-btn {
    background: #ffffff;
    border: 1px solid #d1d5db;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.iframe-wrapper {
    position: relative;
    width: 100%;
    flex-grow: 1;
    overflow: hidden;
    z-index: 10000;
}

.tab-content {
    display: none;
    width: 100%;
    height: 100%;
}

iframe {
    position: absolute;
    left: 0;
    width: 100%;
    top: -5px;
    height: calc(100% + 45px);
    border: none;
    display: block;
    z-index: 2;
}

.loading-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    z-index: 1;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #d6ef29;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   AUTHENTICATION OVERLAY MODULE
   ========================================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(6px);
    z-index: 10010;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 360px;
    border-radius: 20px;
    padding: 28px 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 18px;
}

.modal-field {
    margin-bottom: 14px;
}

.modal-field label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.password-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.modal-input {
    width: 100%;
    padding: 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
}

.modal-input:focus {
    border-color: #d6ef29;
}

.password-toggle {
    position: absolute;
    right: 14px;
    cursor: pointer;
    user-select: none;
    color: #94a3b8;
}

.modal-error {
    display: none;
    font-size: 13px;
    font-weight: 600;
    color: #dc2626;
    margin-bottom: 12px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.modal-btn-cancel { background: #f1f5f9; color: #475569; }
.modal-btn-submit { background: #d6ef29; color: #ffffff; }

/* ==========================================================================
   STRICT MOBILE-FIRST ADAPTIVE MEDIA INJECTIONS
   ========================================================================== */
@media (max-width: 768px) {
    body {
        padding: 24px 14px;
        justify-content: flex-start; /* Better vertical scrolling distribution on phones */
    }

    .app-container {
        padding-top: 10px;
    }

    .portal-title {
        padding-bottom: 1.8rem;
    }

    /* Soften the mobile 3D extrusion slightly on small devices to prevent text aliasing */
    /* .nexams {
        text-shadow: 0px 1px 0px #cbd5e1,
                     0px 2px 0px #94a3b8,
                     0px 3px 1px rgba(0,0,0,0.4),
                     0px 5px 8px rgba(0,0,0,0.3) !important;
    } */
    
    /* .nexams b {
        text-shadow: 0px 1px 0px #a3bf2a,
                     0px 2px 1px rgba(0,0,0,0.4),
                     0px 0px 10px rgba(192, 223, 58, 0.8) !important;
    } */

    /* Convert grid layout to single-column stacking structure cleanly */
    .button-grid {
        /* grid-template-columns: 1fr;  */
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .menu-btn {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        gap: 12px;
        padding: 16px 12px;
        min-height: 170px;
    }


   .btn-icon{
        width: 60px;
        height: 60px;
        min-width: 60px;
    }

    .btn-icon i{
        font-size: 24px;
    }

    .btn-text-content{
        align-items: center;
        text-align: center;
    }

    .btn-text-content .txt-gray,
    .btn-text-content .txt-green{
        font-size: 15px;
        line-height: 1.2;
    }

    .btn-text-content::after{
        margin: 8px auto 0;
    }

    .circuit-bg {
        width: 100%; 
        opacity: 0.8 !important; /* Balanced backdrop layout line visibility for mobile read-flow */
    }
}

@media (max-width:480px){

    .menu-btn{
        min-height: 150px;
        padding: 14px 10px;
    }

    .btn-icon{
        width: 54px;
        height: 54px;
        min-width: 54px;
    }

    .btn-text-content .txt-gray,
    .btn-text-content .txt-green{
        font-size: 14px;
    }
}

/* Entry Transitions mapping */
.btn-expense { animation: slideInLeft 0.6s cubic-bezier(0.165, 0.84, 0.44, 1); }
.btn-ot { animation: slideInRight 0.6s cubic-bezier(0.165, 0.84, 0.44, 1); }
.btn-leave { animation: slideInLeft 0.7s cubic-bezier(0.165, 0.84, 0.44, 1); }
.btn-project { animation: slideInRight 0.7s cubic-bezier(0.165, 0.84, 0.44, 1); }
.btn-advance:nth-of-type(5) { animation: slideInLeft 0.8s cubic-bezier(0.165, 0.84, 0.44, 1); }
.btn-advance:nth-of-type(6) { animation: slideInRight 0.8s cubic-bezier(0.165, 0.84, 0.44, 1); }

@keyframes slideInLeft { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }