/* MLRSNet Premium Earth-Vibe Theme */

:root {
    --bg-0: #071b26;
    --bg-1: #0b2736;
    --bg-2: #113349;
    --card: rgba(15, 35, 49, 0.82);
    --card-border: rgba(156, 223, 204, 0.18);
    --text-0: #ecf4f7;
    --text-1: #c1d5dd;
    --text-2: #89a7b2;
    --brand-0: #53d6aa;
    --brand-1: #35b7cd;
    --accent-0: #f2c879;
    --danger-0: #ef6461;
    --shadow-deep: 0 22px 65px rgba(2, 9, 15, 0.5);
    --shadow-soft: 0 12px 35px rgba(1, 11, 20, 0.28);
    --ring: 0 0 0 3px rgba(83, 214, 170, 0.25);
}

html, body {
    font-family: "Manrope", ui-sans-serif, sans-serif;
    color: var(--text-0);
}

.app-body {
    background:
        radial-gradient(1200px 800px at 10% -10%, rgba(36, 128, 115, 0.28), transparent 58%),
        radial-gradient(900px 650px at 90% -20%, rgba(85, 132, 199, 0.24), transparent 62%),
        linear-gradient(160deg, var(--bg-0), var(--bg-1) 50%, var(--bg-2));
    background-attachment: fixed;
}

.app-nav {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: linear-gradient(90deg, rgba(8, 28, 40, 0.9), rgba(12, 41, 57, 0.88));
    border-bottom: 1px solid rgba(156, 223, 204, 0.15);
    box-shadow: var(--shadow-soft);
}

.app-nav-link {
    color: #d7e6ec;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
}

.app-nav-link:hover {
    color: #8de3c4;
}

.app-ghost-btn {
    border: 1px solid rgba(173, 227, 210, 0.25);
    color: #e4f2f1;
    background: rgba(9, 30, 43, 0.58);
    border-radius: 0.65rem;
    padding: 0.5rem 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.app-ghost-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(173, 227, 210, 0.5);
    background: rgba(20, 52, 63, 0.72);
}

.app-primary-btn {
    background: linear-gradient(96deg, #34caa0, #25a5bb 58%, #297dba);
    box-shadow: 0 12px 24px rgba(34, 169, 145, 0.34);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(34, 169, 145, 0.4);
}

.panel-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-deep);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.fyp-hero {
    background:
        linear-gradient(125deg, rgba(19, 53, 71, 0.85), rgba(14, 65, 72, 0.8) 55%, rgba(25, 47, 86, 0.78)),
        radial-gradient(550px 260px at 16% 15%, rgba(85, 211, 173, 0.24), transparent 64%),
        radial-gradient(520px 260px at 86% 10%, rgba(132, 162, 243, 0.2), transparent 64%);
    border: 1px solid rgba(175, 227, 216, 0.25);
    box-shadow: var(--shadow-deep);
}

.hero-grid {
    background-image: linear-gradient(rgba(183, 232, 221, 0.06) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(183, 232, 221, 0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: radial-gradient(circle at 20% 20%, #000 18%, transparent 76%);
}

.hero-kicker {
    color: #afe4cf;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.hero-chip {
    padding: 0.32rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(177, 228, 212, 0.34);
    color: #d9f4ea;
    background: rgba(16, 62, 67, 0.58);
    font-size: 0.74rem;
    font-weight: 600;
}

.preview-tile {
    height: 76px;
    border-radius: 0.85rem;
    border: 1px solid rgba(196, 231, 220, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.tile-a { background: linear-gradient(115deg, #39606f, #6a9081, #a3b18a); }
.tile-b { background: linear-gradient(130deg, #2d556f, #4f759b, #7393b3); }
.tile-c { background: linear-gradient(120deg, #7e8e67, #b9a778, #cfb87c); }
.tile-d { background: linear-gradient(125deg, #355f59, #468189, #77aca2); }

.upload-zone {
    transition: all 0.24s ease;
    background:
        linear-gradient(180deg, rgba(9, 34, 45, 0.75), rgba(8, 26, 38, 0.84)),
        radial-gradient(300px 160px at 50% -10%, rgba(83, 214, 170, 0.18), transparent 72%);
    border-color: rgba(89, 174, 196, 0.52);
}

.upload-zone:hover {
    border-color: rgba(101, 216, 181, 0.9);
    box-shadow: var(--ring);
}

.upload-zone.dragover {
    border-color: #67e2b7;
    box-shadow: var(--ring), inset 0 0 0 1px rgba(103, 226, 183, 0.35);
}

/* History */
.history-card {
    position: relative;
    overflow: hidden;
    border-radius: 0.85rem;
    border: 1px solid rgba(155, 216, 201, 0.24);
    background: rgba(12, 38, 52, 0.78);
    box-shadow: var(--shadow-soft);
}

.history-thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.history-meta {
    padding: 0.75rem;
}

.history-meta h4 {
    font-size: 0.95rem;
    color: #e3f0f4;
    margin-bottom: 0.22rem;
    font-weight: 700;
}

.history-meta p {
    color: var(--text-1);
    font-size: 0.76rem;
}

.history-delete {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    border: 0;
    background: rgba(8, 22, 31, 0.72);
    color: #f1cbcb;
    cursor: pointer;
    font-weight: 700;
}

.history-delete:hover {
    background: rgba(120, 35, 35, 0.68);
}

/* XAI tabs */
.xai-tab {
    transition: all 0.2s ease;
    cursor: pointer;
}

.xai-tab:hover {
    color: #d0f2e2;
}

.xai-tab.active {
    border-color: #53d6aa !important;
    color: #9aebcb !important;
}

.xai-content {
    animation: fadeIn 0.28s ease-out;
}

/* Utility and legacy-safe styles */
.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: rgba(236, 245, 249, 0.95);
    color: #243642;
    border-radius: 0.6rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.file-name {
    font-weight: 600;
    color: #2e4452;
    flex-grow: 1;
    word-break: break-all;
}

.file-size {
    color: #6b7f89;
    margin-right: 0.5rem;
}

.remove-file {
    cursor: pointer;
    color: #db5b54;
    font-size: 1.25rem;
    line-height: 1;
    transition: transform 0.2s;
}

.remove-file:hover {
    transform: scale(1.2);
}

.flash-message {
    animation: slideIn 0.3s ease-out;
}

#lightbox {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#lightbox img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
}

img.cursor-pointer {
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

img.cursor-pointer:hover {
    transform: scale(1.018);
}

.app-footer {
    border-top: 1px solid rgba(147, 196, 186, 0.2);
    background: rgba(4, 18, 27, 0.82);
    backdrop-filter: blur(8px);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: rgba(8, 27, 37, 0.78);
}

::-webkit-scrollbar-thumb {
    background: rgba(97, 171, 185, 0.7);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(127, 208, 194, 0.88);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .fyp-hero {
        padding: 1.4rem;
    }

    .panel-card {
        padding: 1.2rem !important;
    }

    .history-thumb {
        height: 102px;
    }
}

/* Landing page visuals */
.landing-hero {
    background:
        linear-gradient(124deg, rgba(18, 49, 68, 0.86), rgba(16, 62, 72, 0.82) 52%, rgba(19, 45, 74, 0.8)),
        radial-gradient(600px 300px at 20% 10%, rgba(81, 209, 164, 0.24), transparent 66%),
        radial-gradient(500px 280px at 90% 0%, rgba(128, 151, 229, 0.24), transparent 66%);
    border: 1px solid rgba(169, 226, 210, 0.24);
    box-shadow: var(--shadow-deep);
}

.landing-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(183, 232, 221, 0.06) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(183, 232, 221, 0.06) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: radial-gradient(circle at 30% 20%, #000 20%, transparent 72%);
}

.landing-visual-wrap {
    display: flex;
    justify-content: center;
}

.landing-visual {
    width: 100%;
    max-width: 520px;
    border-radius: 1rem;
    box-shadow: inset 0 0 0 1px rgba(184, 229, 214, 0.2), 0 24px 48px rgba(4, 10, 18, 0.5);
}

/* Auth pages */
.auth-wrap {
    min-height: calc(100vh - 11rem);
    display: flex;
    align-items: center;
}

.auth-shell {
    width: 100%;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: rgba(8, 28, 40, 0.78);
    border: 1px solid rgba(170, 228, 212, 0.22);
    box-shadow: var(--shadow-deep);
}

.auth-side {
    background:
        linear-gradient(145deg, rgba(18, 58, 72, 0.9), rgba(15, 39, 65, 0.85)),
        radial-gradient(360px 220px at 18% 12%, rgba(89, 218, 173, 0.24), transparent 68%);
    border-right: 1px solid rgba(168, 223, 209, 0.2);
}

.auth-form-side {
    background: rgba(10, 32, 46, 0.78);
}

/* Interactive Landing Page Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blob {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotateZ(0deg);
    }
    50% {
        transform: translateY(-20px) rotateZ(2deg);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(83, 214, 170, 0.5), inset 0 0 20px rgba(83, 214, 170, 0.1);
    }
    50% {
        box-shadow: 0 0 40px rgba(83, 214, 170, 0.8), inset 0 0 40px rgba(83, 214, 170, 0.2);
    }
}

/* Animation delay utilities */
.animation-delay-1000 {
    animation-delay: 1s !important;
}

.animation-delay-2000 {
    animation-delay: 2s !important;
}

.animation-delay-4000 {
    animation-delay: 4s !important;
}

/* Fade in animations */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.9s ease-out;
}

/* Floating animation */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Feature cards */
.feature-card {
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Step cards */
.step-card {
    position: relative;
    padding-left: 5rem;
    animation: fadeInUp 0.9s ease-out backwards;
}

.step-number {
    position: absolute;
    left: 0;
    top: 0;
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, #34caa0, #25a5bb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 8px 20px rgba(52, 202, 160, 0.3);
    animation: float 6s ease-in-out infinite;
}

/* Benefit cards */
.benefit-card {
    transition: all 0.3s ease;
}

.benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(83, 214, 170, 0.2);
}

/* Stat boxes */
.stat-box {
    animation: fadeInUp 0.8s ease-out backwards;
}

.stat-number {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

.gradient-text {
    background: linear-gradient(135deg, #53d6aa, #35b7cd, #9ce6ca);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Interactive SVG */
.interactive-svg {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 25px 50px rgba(4, 10, 18, 0.5));
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .step-card {
        padding-left: 4rem;
    }

    .step-number {
        width: 3rem;
        height: 3rem;
        font-size: 1.5rem;
    }

    .landing-hero {
        padding: 2rem 1rem;
    }
}

.auth-label {
    display: block;
    color: var(--text-1);
    font-size: 0.88rem;
    margin-bottom: 0.45rem;
    font-weight: 600;
}

.auth-input {
    width: 100%;
    border-radius: 0.7rem;
    border: 1px solid rgba(148, 190, 203, 0.35);
    background: rgba(12, 35, 50, 0.85);
    color: #edf5f7;
    padding: 0.72rem 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input::placeholder {
    color: #8faab6;
}

.auth-input:focus {
    outline: none;
    border-color: #6fe3ba;
    box-shadow: var(--ring);
}

.auth-bullet {
    border: 1px solid rgba(167, 222, 207, 0.24);
    background: rgba(16, 60, 67, 0.45);
    padding: 0.55rem 0.7rem;
    border-radius: 0.65rem;
}

@media (max-width: 920px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-side {
        border-right: 0;
        border-bottom: 1px solid rgba(168, 223, 209, 0.2);
    }
}
