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

:root {
    --bg-main: #0A0D14;
    --bg-surface: #111827;
    --bg-elevated: #1A2235;
    
    --primary: #6C63FF;
    --primary-glow: rgba(108, 99, 255, 0.3);
    --secondary: #00D9B1;
    --secondary-glow: rgba(0, 217, 177, 0.3);
    
    --danger: #FF4D6D;
    --danger-glow: rgba(255, 77, 109, 0.3);
    --warning: #FFAA00;
    --warning-glow: rgba(255, 170, 0, 0.3);
    
    --text-primary: #F0F4FF;
    --text-muted: #8896A9;
    --border-subtle: #1E2D45;
    
    --glow-effect: 0 0 20px rgba(108, 99, 255, 0.15);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

code, pre, .font-mono {
    font-family: 'JetBrains Mono', monospace;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

input, select, textarea {
    font-family: inherit;
    color: inherit;
    background: transparent;
    border: none;
    outline: none;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Platform Shell Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-item a i {
    font-size: 1.1rem;
    width: 20px;
    display: flex;
    justify-content: center;
}

.sidebar-item:hover a,
.sidebar-item.active a {
    color: var(--text-primary);
    background-color: var(--bg-elevated);
}

.sidebar-item.active a {
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
    background: linear-gradient(90deg, rgba(108, 99, 255, 0.1) 0%, transparent 100%);
}

.sidebar-badge {
    margin-left: auto;
    background-color: var(--primary-glow);
    color: #a5a1ff;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(108, 99, 255, 0.2);
}

.sidebar-badge.highlight {
    background-color: var(--secondary-glow);
    color: #6efce2;
    border-color: rgba(0, 217, 177, 0.2);
}

/* Sidebar Footer Goal widget */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-subtle);
    background-color: rgba(10, 13, 20, 0.5);
}

.sidebar-goal-title {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.sidebar-goal-bar {
    height: 6px;
    background-color: var(--border-subtle);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 6px;
}

.sidebar-goal-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 99px;
    width: 0%;
    transition: width 1s ease-out;
}

.sidebar-goal-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Area Layout */
.main-wrapper {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
}

/* Top Navigation Bar */
.topbar {
    height: 70px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-primary);
}

.page-title {
    font-size: 1.25rem;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    border-color: var(--primary);
    box-shadow: var(--glow-effect);
}

.btn-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background-color: var(--danger);
    color: var(--text-primary);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-surface);
}

.profile-dropdown {
    position: relative;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--text-primary);
    font-weight: 700;
    font-family: 'Syne', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-subtle);
}

.avatar-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 180px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 6px;
    list-style: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: none;
    z-index: 110;
}

.dropdown-menu.show {
    display: block;
    animation: slideDown 0.2s ease;
}

.dropdown-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dropdown-item:hover a {
    color: var(--text-primary);
    background-color: var(--bg-elevated);
}

/* Page content area */
.content-body {
    padding: 32px;
    flex-grow: 1;
}

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

/* Responsive Overrides */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }
    .sidebar-brand span,
    .sidebar-item span,
    .sidebar-footer {
        display: none;
    }
    .sidebar-brand {
        justify-content: center;
        padding: 20px 0;
    }
    .sidebar-item a {
        justify-content: center;
        padding: 12px 0;
    }
    .sidebar-badge {
        position: absolute;
        top: 5px;
        right: 5px;
        font-size: 0.6rem;
        padding: 1px 4px;
        margin-left: 0;
    }
    .sidebar-item {
        position: relative;
    }
    .main-wrapper {
        margin-left: 80px;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: 60px;
        border-right: none;
        border-top: 1px solid var(--border-subtle);
        top: auto;
        bottom: 0;
        flex-direction: row;
        border-bottom: none;
    }
    .sidebar-brand {
        display: none;
    }
    .sidebar-menu {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        padding: 0;
        gap: 0;
    }
    .sidebar-item a {
        flex-direction: column;
        gap: 2px;
        font-size: 0.65rem;
        padding: 8px 0;
        width: 50px;
    }
    .sidebar-item span {
        display: block;
        font-size: 0.65rem;
    }
    .sidebar-item.active a {
        border-left: none;
        border-top: 3px solid var(--primary);
        border-radius: 0;
        background: linear-gradient(0deg, rgba(108, 99, 255, 0.1) 0%, transparent 100%);
    }
    .sidebar-badge {
        display: none;
    }
    .main-wrapper {
        margin-left: 0;
        padding-bottom: 60px; /* offset for bottom menu */
    }
    .topbar {
        padding: 0 16px;
    }
    .content-body {
        padding: 16px;
    }
}
