:root {
    --primary: #4ade80;
    --primary-dark: #166534;
    --primary-light: #bbf7d0;
    --secondary: #8b5a2b;
    --accent: #22c55e;
    --accent-glow: rgba(74, 222, 128, 0.4);
    
    --islamic-gradient: linear-gradient(135deg, #065f46, #064e3b);
    --reading-gradient: linear-gradient(135deg, #8b5a2b, #5c3a18);
    --science-gradient: linear-gradient(135deg, #6C5CE7, #4A2511);
    --math-gradient: linear-gradient(135deg, #4ade80, #166534);
    
    --bg-dark: #1e1e1e;
    --bg-card: #2d2d2d;
    --wood-border: #8b5a2b;
    
    --glass: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(2, 132, 199, 0.1);
    --glass-shine: rgba(2, 132, 199, 0.05);
    
    --transition-lux: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Outfit', sans-serif;
    background-color: #87CEEB; /* Minecraft Sky */
    background-image: 
        linear-gradient(rgba(135, 206, 235, 0.8), rgba(135, 206, 235, 0.9)),
        url('data:image/svg+xml;utf8,<svg width="40" height="40" xmlns="http://www.w3.org/2000/svg"><rect width="40" height="40" fill="none"/><rect width="20" height="20" fill="%234ade80" fill-opacity="0.2"/><rect x="20" y="20" width="20" height="20" fill="%234ade80" fill-opacity="0.2"/></svg>');
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

body.locked {
    overflow: hidden;
    height: 100vh;
}

/* Lab Background */
.lab-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background-color: #87CEEB; /* Minecraft Sky */
    background-image: 
        linear-gradient(rgba(135, 206, 235, 0.6), rgba(135, 206, 235, 0.8)),
        url('data:image/svg+xml;utf8,<svg width="40" height="40" xmlns="http://www.w3.org/2000/svg"><rect width="40" height="40" fill="none"/><rect width="20" height="20" fill="%23ffffff" fill-opacity="0.1"/><rect x="20" y="20" width="20" height="20" fill="%23ffffff" fill-opacity="0.1"/></svg>');
}

/* Login Overlay Styles - SMART LAB THEME */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999; /* Ultra high priority */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s;
}

.login-overlay.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-box {
    background: #c6c6c6; /* Minecraft Stone */
    border: 6px solid #555555; /* Dark stone border */
    border-top-color: #ffffff;
    border-left-color: #ffffff;
    padding: 60px 40px;
    border-radius: 0;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lock-icon {
    width: 100px;
    height: 100px;
    background: #4ade80;
    border: 6px solid #166534;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    box-shadow: 5px 5px 0px rgba(0,0,0,0.3);
    padding: 0;
    overflow: hidden;
}

.lock-icon img { width: 100%; height: 100%; object-fit: cover; }
.lock-icon i { width: 40px; height: 40px; color: #fff; }

.login-box h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    color: #ffffff;
    text-shadow: 3px 3px 0 #333;
    font-weight: 900;
}

.login-box p {
    color: #333333;
    margin-bottom: 35px;
    font-size: 1.2rem;
    font-weight: 800;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#access-code {
    background: #000000;
    border: 4px solid #555555;
    padding: 20px;
    border-radius: 0;
    color: #ffffff;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 5px;
    outline: none;
    transition: all 0.3s ease;
    font-weight: bold;
    font-family: monospace;
}

#access-code:focus {
    background: #222222;
    border-color: #4ade80;
    box-shadow: inset 0 0 10px #4ade80;
}

#login-btn {
    background: #4ade80;
    color: #166534;
    border: 4px solid #166534;
    border-top-color: #bbf7d0;
    border-left-color: #bbf7d0;
    padding: 20px;
    border-radius: 0;
    font-size: 1.4rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: all 0.1s ease;
    box-shadow: 5px 5px 0px rgba(0, 0, 0, 0.5);
    font-family: 'Cairo', sans-serif;
}

#login-btn:hover {
    background: #22c55e;
}
#login-btn:active {
    transform: translate(5px, 5px);
    box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.5);
}

.error-msg {
    color: #ef4444 !important;
    margin-top: 20px;
    min-height: 24px;
    font-weight: 700;
}

.login-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 600;
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Content Wrapper (Portal) --- */
.portal-wrapper {
    width: 100%;
    max-width: 1300px;
    padding: 60px 40px;
    z-index: 1;
}

/* Luxurious Header */
.main-portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 80px;
    animation: fadeInDown 1s ease-out;
}

.profile-section {
    display: flex;
    align-items: center;
    gap: 25px;
}

.avatar-glow {
    width: 100px;
    height: 100px;
    background: var(--primary-light);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 5px 5px 0px rgba(0,0,0,0.3);
    position: relative;
    border: 6px solid var(--primary-dark);
    padding: 0;
    overflow: hidden;
}

.avatar-glow img { width: 100%; height: 100%; object-fit: cover; }

.greeting {
    font-size: 1.1rem;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
    font-weight: 800;
    text-shadow: 1px 1px 0px #fff;
}

.student-name {
    font-size: 2.8rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 3px 3px 0 #166534;
}

.brand-badge {
    background: #c6c6c6;
    border: 4px solid #555555;
    border-top-color: #ffffff;
    border-left-color: #ffffff;
    padding: 12px 25px;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 5px 5px 0px rgba(0,0,0,0.3);
}

.badge-text {
    font-weight: 800;
    color: #333;
    letter-spacing: 1px;
}

/* Intro Section */
.portal-intro {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeIn 1.2s ease-out;
}

.section-title {
    font-size: 2rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 3px 3px 0 #166534;
    margin-bottom: 15px;
}

.title-underline {
    width: 80px;
    height: 4px;
    background: var(--secondary);
    margin: 0 auto;
    border-radius: 2px;
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.3);
}

/* Luxury Grid */
.lux-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 35px;
    perspective: 1000px;
}

.lux-card {
    width: 100%;
    max-width: 450px;
    text-decoration: none;
    color: #ffffff;
    background: #8b5a2b; /* Dirt block */
    border: 6px solid #4a3018; /* Dark dirt */
    border-top-color: #4ade80; /* Grass top */
    border-left-color: #c78b4f;
    border-radius: 0;
    padding: 2rem;
    transition: var(--transition-lux);
    position: relative;
    box-shadow: 8px 8px 0px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    animation: slideUp 1s ease-out forwards;
    opacity: 0;
}

.lux-card::before {
    display: none;
}
.lux-card::after { 
    display: none; 
}

.lux-card:nth-child(1) { animation-delay: 0.1s; }
.lux-card:nth-child(2) { animation-delay: 0.2s; }
.lux-card:nth-child(3) { animation-delay: 0.3s; }
.lux-card:nth-child(4) { animation-delay: 0.4s; }

.lux-card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 1;
    position: relative;
}

.lux-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 35px rgba(249, 115, 22, 0.15), inset 0 0 15px rgba(2, 132, 199, 0.05);
    border-color: var(--secondary);
}

.lux-icon {
    width: 100px;
    height: 100px;
    border-radius: 0;
    border: 4px solid #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    box-shadow: 5px 5px 0px rgba(0,0,0,0.5);
    transition: var(--transition-lux);
}

.lux-icon i {
    width: 48px;
    height: 48px;
    color: white;
}

.lux-card h3 {
    font-size: 1.7rem;
    font-weight: 900;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
    color: #ffffff;
    text-shadow: 2px 2px 0 #333;
}

.lux-card p {
    color: #e0e0e0;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 40px;
    min-height: 50px;
    font-weight: 700;
    text-shadow: 1px 1px 0 #333;
}

.lux-action {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
    font-size: 1.1rem;
    color: #bbf7d0;
    transition: var(--transition-lux);
    margin-top: auto;
    text-shadow: 1px 1px 0 #166534;
}

.lux-action i {
    width: 18px;
    height: 18px;
    transition: var(--transition-lux);
}

.lux-card:hover .lux-action {
    color: var(--secondary);
}

.lux-card:hover .lux-action i {
    transform: translateX(-8px);
}

/* Card Specific Luxury Themes */
.islamic-lux .lux-icon { background: var(--islamic-gradient); border: 2px solid #059669; }
.islamic-lux:hover { box-shadow: 0 25px 60px rgba(6, 78, 59, 0.4); }

.reading-lux .lux-icon { background: var(--reading-gradient); border: 2px solid #d97706; }
.reading-lux:hover { box-shadow: 0 25px 60px rgba(146, 64, 14, 0.4); }

.science-lux .lux-icon { background: var(--science-gradient); border: 2px solid #0d9488; }
.science-lux:hover { box-shadow: 0 25px 60px rgba(15, 118, 110, 0.4); }

.math-lux .lux-icon { background: var(--math-gradient); border: 2px solid #4f46e5; }
.math-lux:hover { box-shadow: 0 25px 60px rgba(55, 48, 163, 0.4); }

/* Footer */
.lux-footer {
    margin-top: 100px;
    text-align: center;
    padding-bottom: 40px;
}

.footer-line {
    width: 100px;
    height: 1px;
    background: #cbd5e1;
    margin: 0 auto 30px;
}

.lux-footer p {
    font-size: 1rem;
    color: #ffffff;
    letter-spacing: 1px;
    font-weight: 800;
    text-shadow: 1px 1px 0 #333;
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(50px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 1024px) {
    .portal-wrapper { padding: 40px 20px; }
    .student-name { font-size: 2.2rem; }
}

@media (max-width: 768px) {
    .main-portal-header { flex-direction: column; gap: 30px; text-align: center; }
    .profile-section { flex-direction: column; }
    .lux-grid { grid-template-columns: 1fr; }
}
