:root {
    --bg-dark: #0f0c29;
    --bg-gradient-1: #302b63;
    --bg-gradient-2: #24243e;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    
    --primary-accent: #00f2ff;
    --secondary-accent: #bd00ff;
    
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    
    --font-family: 'Outfit', sans-serif;
    
    --sidebar-width: 260px;
    --header-height: 80px;
    --gap: 24px;
    --radius: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-dark); /* Fallback */
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-gradient-1), var(--bg-gradient-2));
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* Moving Background Effect */
.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 15% 50%, rgba(189, 0, 255, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 242, 255, 0.15), transparent 25%);
    animation: bgPulse 10s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.app-container {
    display: flex;
    height: 100%;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: calc(100% - 32px);
    margin: 16px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    padding: 24px;
    transition: width 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(45deg, var(--primary-accent), var(--secondary-accent));
    border-radius: 8px;
    box-shadow: 0 0 15px var(--primary-accent);
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-item svg {
    stroke: var(--text-muted);
    transition: stroke 0.3s ease;
}

.nav-item:hover, .nav-item.active {
    background: var(--glass-highlight);
    color: var(--text-main);
}

.nav-item:hover svg, .nav-item.active svg {
    stroke: var(--primary-accent);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.avatar-circle {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 18px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-weight: 600;
    font-size: 14px;
}

.user-info .status {
    font-size: 12px;
    color: var(--primary-accent);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 16px 16px 0;
    gap: 16px;
}

.top-bar {
    height: var(--header-height);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.search-container {
    position: relative;
    width: 400px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

#app-search {
    width: 100%;
    padding: 12px 12px 12px 48px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

#app-search:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--primary-accent);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.1);
}

.header-actions {
    display: flex;
    gap: 16px;
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    color: var(--text-main);
    background: var(--glass-highlight);
}

.content-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: min-content;
    gap: 24px;
}

/* Scrollbar Customization */
.content-body::-webkit-scrollbar {
    width: 6px;
}
.content-body::-webkit-scrollbar-track {
    background: transparent;
}
.content-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.content-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* App Card */
.app-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.app-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
}

.app-card:hover::before {
    opacity: 1;
}

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.app-info {
    text-align: center;
    z-index: 1;
}

.app-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.app-category {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0,0,0,0.2);
    padding: 4px 10px;
    border-radius: 20px;
}

.app-desc {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-card {
    animation: fadeIn 0.5s ease-out forwards;
}
