:root {
    --bg-main: #0b0f17;      
    --sidebar-bg: #0f1524;   
    --card-bg: #141b2d;  
    --neon-blue: #3b82f6;
    --neon-green: #10b981;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --cyber-glow: 0 0 20px rgba(59, 130, 246, 0.25), 0 0 40px rgba(16, 185, 129, 0.15);
    --border-glow: 1px solid rgba(255, 255, 255, 0.08);
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
}

.app-layout {
    display: flex;
    height: 100vh;
}

.app-sidebar {
    width: 240px;
    background-color: var(--sidebar-bg);
    border-right: var(--border-glow);
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.sidebar-top .logo {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 1px;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 40px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15), rgba(16, 185, 129, 0.05));
    border-left: 3px solid var(--neon-blue);
    color: var(--text-primary);
    font-weight: 600;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px 60px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
    gap: 20px;
    flex-wrap: wrap;
}

.greeting h1 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.greeting p {
    margin: 6px 0 0 0;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-bar input {
    border: var(--border-glow);
    border-radius: 10px;
    padding: 12px 18px;
    width: 260px;
    background-color: rgba(20, 27, 45, 0.6);
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.create-btn {
    background: linear-gradient(135deg, var(--neon-blue) 0%, var(--neon-green) 100%);
    color: #ffffff;
    border: none;
    padding: 12px 26px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.create-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--cyber-glow);
    filter: brightness(1.1);
}

.designs-section h2 {
    font-size: 1.4rem;
    margin-bottom: 24px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.design-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}

.deck-card {
    background: var(--card-bg);
    border: var(--border-glow);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.3s ease;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    animation: neonBloomEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: calc(var(--card-index) * 0.08s);
}

.deck-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(59, 130, 246, 0.15);
}

.card-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #090d16;
    padding: 14px;
    box-sizing: border-box;
    border-bottom: var(--border-glow);
}

.slide-mini {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.3);
    transition: transform 0.4s ease;
}

.deck-card:hover .slide-mini {
    transform: scale(1.03); 
}

.slide-mini h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.card-info {
    padding: 18px;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.2) 100%);
}

.deck-title {
    margin: 0 0 6px 0;
    font-size: 1.05rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.deck-meta {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.profile-container {
    position: relative;
    display: inline-block;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(20, 27, 45, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 14px;
    border-radius: 20px;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.profile-trigger:hover {
    border-color: var(--neon-blue);
    background: rgba(20, 27, 45, 0.9);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.avatar-fallback {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-green));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.chevron-icon {
    font-size: 0.65rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.profileDropdownMenu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    background: #0f1524;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 0 0 30px rgba(59, 130, 246, 0.05);
    z-index: 1000;
    overflow: hidden;
    transform-origin: top right;
    animation: dropdownReveal 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-meta-details h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.user-meta-details p {
    margin: 2px 0 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0;
}

.dropdownActionLinks {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dropdown-item {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    transform: translateX(2px);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

@keyframes dropdownReveal {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes neonBloomEntrance {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 1024px) {
    .main-content {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .app-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        height: 70px;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        padding: 0 12px !important;
        background-color: rgba(15, 21, 36, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-right: none;
        border-top: var(--border-glow);
        z-index: 9999;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
        box-sizing: border-box;
    }

    .sidebar-top {
        display: none;
    }

    .sidebar-nav {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        gap: 0;
    }

    .nav-item {
        font-size: 0.85rem !important;
        padding: 10px;
        text-align: center;
        flex: 1;
        border-radius: 8px;
    }

    .nav-item.active {
        border-left: none;
        border-bottom: 3px solid var(--neon-blue);
        background: rgba(59, 130, 246, 0.1);
    }

    .main-content {
        padding: 24px 20px 120px 20px !important; 
        width: 100%;
        box-sizing: border-box;
    }

    .app-header {
        display: grid;
        grid-template-columns: 1fr auto; 
        align-items: center;
        margin-bottom: 32px;
        gap: 20px;
    }

    .greeting {
        grid-column: 1;
    }

    .greeting h1 {
        font-size: 1.8rem;
    }
    
    .greeting p {
        font-size: 0.9rem;
    }

    .profile-container {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        justify-content: flex-end;
    }

    .profile-trigger {
        padding: 6px 12px;
    }

    .header-actions {
        grid-column: 1 / span 2; 
        display: flex;
        flex-direction: column;
        gap: 14px;
        width: 100%;
    }

    .create-btn {
        width: 100%;
        padding: 14px;
        text-align: center;
        box-sizing: border-box;
        font-size: 1rem;
    }

    .search-bar {
        width: 100%;
    }

    .search-bar input {
        width: 100% !important;
        box-sizing: border-box;
        padding: 14px 18px;
    }

    .design-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .profileDropdownMenu {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        left: auto;
        width: 280px;
        transform-origin: top right;
    }
}