/* 
 * Project: Secret Yerenk
 * Theme: Dark Liquid Love
 * Style: High-end Dark Glassmorphism
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Dark Palette */
    --color-bg-1: #0f0c29;
    --color-bg-2: #302b63;
    --color-bg-3: #24243e;

    --color-accent-pink: #ff0055;
    --color-accent-blue: #00c6ff;
    --color-accent-purple: #9d50bb;

    --color-text-main: #ffffff;
    --color-text-muted: #b3b3b3;

    /* Dark Glass */
    --color-glass-bg: rgba(20, 20, 30, 0.6);
    --color-glass-border: rgba(255, 255, 255, 0.1);
    --color-input-bg: rgba(0, 0, 0, 0.3);

    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-neon: 0 0 10px rgba(255, 0, 85, 0.5);

    /* Animation Speeds */
    --anim-slow: 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Strict no-scroll */
    overscroll-behavior: none;
    /* Prevent bounce effects */
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Inter', sans-serif;
    background-image: url('assets/background-main.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-main);
    position: fixed;
    /* Lock viewport for mobile */
    top: 0;
    left: 0;
}

/* Background Animation */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Animated Orbs for Atmosphere */
.mesh-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    z-index: -1;
    animation: float 20s infinite;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: var(--color-accent-purple);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: var(--color-accent-pink);
    animation-delay: -5s;
}

.blob-3 {
    top: 30%;
    left: 40%;
    width: 300px;
    height: 300px;
    background: var(--color-accent-blue);
    opacity: 0.3;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -50px) rotate(10deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(-5deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

/* Main Container */
.app-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    z-index: 10;
    height: 100dvh;
    overflow-y: auto;
    /* Allow internal scrolling if content overflows */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dashboard-container {
    justify-content: flex-start;
    /* Align top for dashboard */
    padding-top: 60px;
}

/* Glass Card */
.glass-card {
    background: var(--color-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-glass-border);
    border-radius: 24px;
    padding: 48px 32px;
    box-shadow: var(--shadow-glass);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Login UI */
.login-header {
    margin-bottom: 40px;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(45deg, #fff, #b3b3b3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
}

/* 4-Box PIN Layout */
.pin-wrapper {
    position: relative;
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.real-pin-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    font-size: 1px;
}

.pin-box {
    width: 60px;
    height: 70px;
    background: var(--color-input-bg);
    border: 1px solid var(--color-glass-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 600;
    color: var(--color-text-main);
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.pin-box.active {
    border-color: var(--color-accent-pink);
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.3), inset 0 2px 5px rgba(0, 0, 0, 0.2);
    background: rgba(255, 0, 85, 0.1);
}

.pin-box.filled {
    border-color: var(--color-accent-blue);
    background: rgba(0, 198, 255, 0.1);
}

.btn-primary {
    background: linear-gradient(45deg, var(--color-accent-pink), var(--color-accent-purple));
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 0, 85, 0.4);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Dashboard Styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 0 8px;
}

.header-content h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(45deg, #fff, #b3b3b3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-content p {
    font-size: 13px;
    color: var(--color-accent-blue);
    opacity: 0.8;
}

.logout-btn {
    font-size: 24px;
    color: var(--color-text-muted);
    transition: color 0.3s;
}

.logout-btn:hover {
    color: var(--color-accent-pink);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding-bottom: 40px;
}

.app-card {
    background: var(--color-glass-bg);
    border: 1px solid var(--color-glass-border);
    border-radius: 20px;
    padding: 24px 16px;
    text-align: center;
    text-decoration: none;
    color: var(--color-text-main);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.app-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.app-card:active {
    transform: scale(0.98);
}

.app-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.app-card p {
    font-size: 11px;
    color: var(--color-text-muted);
}

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.05);
}

.color-pink {
    color: var(--color-accent-pink);
    background: rgba(255, 0, 85, 0.1);
}

.color-purple {
    color: var(--color-accent-purple);
    background: rgba(157, 80, 187, 0.1);
}

.color-blue {
    color: var(--color-accent-blue);
    background: rgba(0, 198, 255, 0.1);
}

.color-gray {
    color: var(--color-text-muted);
}

.app-card.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(0.8);
}

/* Intro Animations */
.delay-1 {
    animation: fadeInUp 0.5s ease 0.1s both;
}

.delay-2 {
    animation: fadeInUp 0.5s ease 0.2s both;
}

.delay-3 {
    animation: fadeInUp 0.5s ease 0.3s both;
}

.delay-4 {
    animation: fadeInUp 0.5s ease 0.4s both;
}

.error-msg {
    color: #ff4d4d;
    font-size: 13px;
    margin-top: 10px;
    height: 18px;
    opacity: 0;
    visibility: hidden;
    /* Ensure it's not clickable or readable by readers */
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.error-msg.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .app-container {
        padding: 16px;
    }

    .glass-card {
        padding: 32px 20px;
        border-radius: 20px;
        width: 100%;
        margin: 0;
    }

    .login-title {
        font-size: 24px;
    }

    .login-subtitle {
        font-size: 13px;
    }

    .pin-wrapper {
        gap: 8px;
    }

    .pin-box {
        width: 50px;
        height: 60px;
        font-size: 24px;
        border-radius: 10px;
    }

    .btn-primary {
        padding: 14px 24px;
        font-size: 15px;
    }
}

@media (max-width: 350px) {
    .pin-box {
        width: 45px;
        height: 55px;
        font-size: 20px;
    }

    .pin-wrapper {
        gap: 6px;
    }

    .glass-card {
        padding: 24px 16px;
    }

    .dashboard-grid {
        gap: 10px;
    }

    .app-card {
        padding: 20px 12px;
    }
}

@supports (height: 100dvh) {
    body {
        min-height: 100dvh;
    }
}