/* Base Variables and Reset */
:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --font-main: 'Outfit', sans-serif;
}

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

body,
html {
    width: 100%;
    height: 100%;
    font-family: var(--font-main);
    background: var(--bg-gradient);
    color: var(--text-primary);
    overflow: hidden;
    /* App view handles internal scrolling if needed */
}

/* Views Management */
.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out, visibility 0.5s;
    transform: scale(0.95);
    display: flex;
}

.view.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: scale(1);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

/* ------ LOGIN VIEW ------ */
#login-view {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Background Blobs for depth */
.circle-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #8b5cf6;
    top: -100px;
    left: -100px;
    animation: drift 10s infinite alternate ease-in-out;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #ec4899;
    bottom: -50px;
    right: -50px;
    animation: drift 12s infinite alternate-reverse ease-in-out;
}

@keyframes drift {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(50px) scale(1.1);
    }
}

/* Glassmorphism Card */
.glassmorphism {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
    transform: translateY(20px);
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}

.logo-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(to right, #ffffff, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: 2.5rem;
}

/* Buttons */
.primary-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px -10px var(--accent);
    width: 100%;
}

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px var(--accent);
}

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

.secondary-btn {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ------ MAIN APP VIEW ------ */
#app-view {
    background: #000;
    flex-direction: row;
    /* Sidebar layout */
}

/* Sidebar */
.app-sidebar {
    width: 260px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    z-index: 10;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2.5rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 1rem 1.2rem;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--accent);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

/* App Main Area */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.glassmorphism-header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.glassmorphism-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #e2e8f0;
}

.app-content {
    flex: 1;
    width: 100%;
    height: 100%;
    position: relative;
    background: #0f172a;
    /* Fallback */
}

.app-content iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    transition: opacity 0.3s ease;
    opacity: 1;
}

.app-content iframe.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Welcome Screen */
.welcome-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 5;
}

.welcome-screen.active {
    opacity: 1;
    pointer-events: all;
}

.welcome-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem;
    max-width: 500px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.welcome-card h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #ffffff, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.coming-soon-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #c4b5fd;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Header Left to hold hamburger and title */
.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    background: transparent;
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    display: none;
    /* Hidden by default on desktop */
    padding: 0.5rem;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}


/* --- RESPONSIVE DESIGN --- */

@media (max-width: 768px) {

    /* Login Screen Responsiveness */
    .glassmorphism {
        padding: 2rem;
    }

    .logo-title {
        font-size: 1.8rem;
    }

    .blob-1 {
        width: 250px;
        height: 250px;
    }

    .blob-2 {
        width: 200px;
        height: 200px;
    }

    /* App View Responsiveness */
    .app-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 20;
    }

    .app-sidebar.active {
        transform: translateX(0);
    }

    .icon-btn {
        display: flex;
    }

    .glassmorphism-header h2 {
        font-size: 1rem;
    }

    .secondary-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}