/* ========================================
   LIFE DASHBOARD — Design System
   ======================================== */

/* --- CSS Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --bg-primary: #0a0a1a;
    --bg-secondary: #111128;
    --bg-card: rgba(25, 25, 60, 0.6);
    --bg-card-hover: rgba(35, 35, 80, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-hover: rgba(255, 255, 255, 0.15);

    /* Accent Colors */
    --purple: #8B5CF6;
    --purple-glow: rgba(139, 92, 246, 0.3);
    --cyan: #06B6D4;
    --cyan-glow: rgba(6, 182, 212, 0.3);
    --pink: #EC4899;
    --pink-glow: rgba(236, 72, 153, 0.3);
    --green: #10B981;
    --green-glow: rgba(16, 185, 129, 0.3);
    --orange: #F59E0B;
    --orange-glow: rgba(245, 158, 11, 0.3);
    --red: #EF4444;
    --red-glow: rgba(239, 68, 68, 0.3);
    --blue: #3B82F6;
    --blue-glow: rgba(59, 130, 246, 0.3);

    /* Gradient */
    --gradient-primary: linear-gradient(135deg, #8B5CF6, #06B6D4);
    --gradient-pink: linear-gradient(135deg, #EC4899, #8B5CF6);
    --gradient-green: linear-gradient(135deg, #10B981, #06B6D4);
    --gradient-orange: linear-gradient(135deg, #F59E0B, #EC4899);
    --gradient-blue: linear-gradient(135deg, #3B82F6, #8B5CF6);

    /* Text */
    --text-primary: #f0f0ff;
    --text-secondary: #a0a0c0;
    --text-muted: #606080;

    /* Sizing */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50%;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
    --shadow-glow-purple: 0 0 20px var(--purple-glow);
    --shadow-glow-cyan: 0 0 20px var(--cyan-glow);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Fonts */
    --font-body: 'Cairo', sans-serif;
    --font-heading: 'Cairo', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    direction: rtl;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--purple-glow) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -50%;
    left: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--cyan-glow) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.15);
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-normal), transform var(--transition-normal);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-glass);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    transition: opacity var(--transition-normal);
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .quote-widget {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
}

.sidebar-toggle {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--border-glass);
    color: var(--text-primary);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-glass);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    white-space: nowrap;
    transition: opacity var(--transition-normal);
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.nav-item:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(139, 92, 246, 0.15);
    color: var(--purple);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--gradient-primary);
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-label {
    transition: opacity var(--transition-normal);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-glass);
}

.quote-widget {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    transition: opacity var(--transition-normal);
}

.quote-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.quote-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    display: block;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    position: relative;
    z-index: 1;
    transition: margin-right var(--transition-normal);
}

.sidebar.collapsed ~ .main-content {
    margin-right: var(--sidebar-collapsed);
}

.page-container {
    padding: 32px;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes ringPulse {
    0% { box-shadow: 0 0 0 0 var(--purple-glow); }
    70% { box-shadow: 0 0 0 10px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* ========================================
   PAGE HEADER
   ======================================== */
.page-header {
    margin-bottom: 28px;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

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

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(12px);
    transition: all var(--transition-normal);
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glass-hover);
    box-shadow: var(--shadow-md);
}

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

.card-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========================================
   STAT CARDS (Dashboard)
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    animation: slideUp 0.5s ease backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-glass-hover);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
}

.stat-card.purple::after { background: var(--gradient-primary); }
.stat-card.green::after { background: var(--gradient-green); }
.stat-card.pink::after { background: var(--gradient-pink); }
.stat-card.orange::after { background: var(--gradient-orange); }

.stat-icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 13px;
}

/* ========================================
   GRID LAYOUTS
   ======================================== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow-purple);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--purple-glow);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: var(--border-glass);
    border-color: var(--border-glass-hover);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 16px;
}

.btn-icon:hover {
    background: var(--border-glass);
    color: var(--text-primary);
}

/* ========================================
   FORM ELEMENTS
   ======================================== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--purple-glow);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0a0c0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 32px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* ========================================
   BADGES & TAGS
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-purple { background: rgba(139,92,246,.15); color: var(--purple); }
.badge-green { background: rgba(16,185,129,.15); color: var(--green); }
.badge-pink { background: rgba(236,72,153,.15); color: var(--pink); }
.badge-orange { background: rgba(245,158,11,.15); color: var(--orange); }
.badge-red { background: rgba(239,68,68,.15); color: var(--red); }
.badge-blue { background: rgba(59,130,246,.15); color: var(--blue); }
.badge-cyan { background: rgba(6,182,212,.15); color: var(--cyan); }

/* ========================================
   PROGRESS BAR
   ======================================== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-glass);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--gradient-primary);
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* ========================================
   COMPLETION RING
   ======================================== */
.completion-ring {
    position: relative;
    width: 120px;
    height: 120px;
}

.completion-ring svg {
    transform: rotate(-90deg);
}

.completion-ring .ring-bg {
    fill: none;
    stroke: var(--bg-glass);
    stroke-width: 8;
}

.completion-ring .ring-fill {
    fill: none;
    stroke: url(#gradient);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.completion-ring .ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.ring-percentage {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    display: block;
}

.ring-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* ========================================
   MODAL
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

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

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 28px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(239,68,68,0.15);
    color: var(--red);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    font-size: 14px;
    margin-bottom: 20px;
}

/* ========================================
   LIST ITEMS
   ======================================== */
.list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    animation: slideUp 0.3s ease backwards;
}

.list-item:hover {
    background: var(--bg-card);
    border-color: var(--border-glass-hover);
}

.list-item + .list-item {
    margin-top: 8px;
}

/* Checkbox */
.checkbox {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--border-glass-hover);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    font-size: 12px;
}

.checkbox:hover {
    border-color: var(--purple);
}

.checkbox.checked {
    background: var(--gradient-primary);
    border-color: transparent;
    animation: pulse 0.3s ease;
}

.list-item.completed .list-item-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.list-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.list-item-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.list-item:hover .list-item-actions {
    opacity: 1;
}

/* ========================================
   TABS / FILTERS
   ======================================== */
.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
    font-family: var(--font-body);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: var(--purple);
    color: white;
    box-shadow: var(--shadow-glow-purple);
}

/* ========================================
   HABITS
   ======================================== */
.habit-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.habit-row + .habit-row {
    margin-top: 8px;
}

.habit-row:hover {
    background: var(--bg-card);
}

.habit-info {
    flex: 1;
    min-width: 0;
}

.habit-name {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.habit-streak {
    font-size: 12px;
    color: var(--orange);
    display: flex;
    align-items: center;
    gap: 4px;
}

.habit-days {
    display: flex;
    gap: 6px;
}

.habit-day {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.habit-day:hover {
    border-color: var(--purple);
}

.habit-day.done {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    font-weight: 700;
}

.habit-day.today {
    border-color: var(--cyan);
    box-shadow: 0 0 8px var(--cyan-glow);
}

.habit-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.habit-row:hover .habit-actions {
    opacity: 1;
}

/* ========================================
   GOALS
   ======================================== */
.goal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition-normal);
}

.goal-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.goal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.goal-title {
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.goal-progress-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.goal-percentage {
    color: var(--purple);
    font-weight: 600;
}

.goal-milestones {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-glass);
}

.milestone {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.milestone.done {
    color: var(--text-muted);
    text-decoration: line-through;
}

.milestone-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-glass-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.milestone.done .milestone-check {
    background: var(--green);
    border-color: var(--green);
}

.goal-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.goal-card:hover .goal-actions {
    opacity: 1;
}

/* ========================================
   FINANCE
   ======================================== */
.finance-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.finance-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}

.finance-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.finance-stat-value {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
}

.finance-stat-value.income { color: var(--green); }
.finance-stat-value.expense { color: var(--red); }
.finance-stat-value.balance { color: var(--purple); }

.finance-chart {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    height: 160px;
    padding: 16px 0;
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar {
    width: 100%;
    max-width: 40px;
    border-radius: 6px 6px 0 0;
    transition: height 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    min-height: 4px;
}

.chart-bar-label {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
}

.chart-bar-value {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 600;
}

.transaction-list {
    max-height: 400px;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.transaction-item + .transaction-item {
    margin-top: 6px;
}

.transaction-item:hover {
    background: var(--bg-card);
}

.transaction-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.transaction-icon.income {
    background: rgba(16,185,129,0.15);
}

.transaction-icon.expense {
    background: rgba(239,68,68,0.15);
}

.transaction-info {
    flex: 1;
}

.transaction-name {
    font-size: 14px;
    font-weight: 500;
}

.transaction-date {
    font-size: 11px;
    color: var(--text-muted);
}

.transaction-amount {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
}

.transaction-amount.income { color: var(--green); }
.transaction-amount.expense { color: var(--red); }

.transaction-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.transaction-item:hover .transaction-actions {
    opacity: 1;
}

/* ========================================
   NOTES
   ======================================== */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.note-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    min-height: 140px;
}

.note-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-glass-hover);
}

.note-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
}

.note-card.color-purple::before { background: var(--purple); }
.note-card.color-cyan::before { background: var(--cyan); }
.note-card.color-pink::before { background: var(--pink); }
.note-card.color-green::before { background: var(--green); }
.note-card.color-orange::before { background: var(--orange); }

.note-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 8px;
}

.note-preview {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-meta {
    margin-top: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.note-card .note-delete {
    position: absolute;
    top: 12px;
    left: 12px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.note-card:hover .note-delete {
    opacity: 1;
}

/* ========================================
   POMODORO
   ======================================== */
.pomodoro-container {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.pomodoro-timer {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 40px auto;
}

.pomodoro-timer svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.pomodoro-timer .timer-bg {
    fill: none;
    stroke: var(--bg-glass);
    stroke-width: 6;
}

.pomodoro-timer .timer-fill {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.timer-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.timer-time {
    font-family: var(--font-heading);
    font-size: 56px;
    font-weight: 700;
    letter-spacing: 2px;
}

.timer-status {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.pomodoro-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.pomodoro-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 32px;
}

.pomo-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px;
}

.pomo-stat-value {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--purple);
}

.pomo-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.pomodoro-settings {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    text-align: right;
}

.settings-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.setting-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.setting-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-value input {
    width: 60px;
    padding: 6px 8px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    text-align: center;
    outline: none;
}

.setting-value input:focus {
    border-color: var(--purple);
}

/* ========================================
   CALENDAR
   ======================================== */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.calendar-month {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day-label {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 0;
    font-weight: 600;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    border: 1px solid transparent;
    gap: 4px;
}

.calendar-day:hover {
    background: var(--bg-card);
    border-color: var(--border-glass);
}

.calendar-day.today {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--purple);
    font-weight: 700;
    color: var(--purple);
}

.calendar-day.other-month {
    color: var(--text-muted);
    opacity: 0.4;
}

.calendar-day.has-events::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cyan);
    position: absolute;
    bottom: 6px;
}

.calendar-events {
    margin-top: 24px;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.event-item + .event-item {
    margin-top: 6px;
}

.event-item:hover {
    background: var(--bg-card);
}

.event-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.event-info {
    flex: 1;
}

.event-title {
    font-size: 14px;
    font-weight: 500;
}

.event-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.event-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.event-item:hover .event-actions {
    opacity: 1;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    .finance-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
        width: var(--sidebar-width);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
    }

    .page-container {
        padding: 20px 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .habit-days {
        gap: 4px;
    }

    .habit-day {
        width: 28px;
        height: 28px;
    }

    .pomodoro-timer {
        width: 240px;
        height: 240px;
    }

    .timer-time {
        font-size: 44px;
    }

    .pomodoro-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .mobile-menu-btn {
        display: flex !important;
    }

    .notes-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        flex-direction: column;
    }
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    z-index: 98;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow-purple);
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    transform: scale(1.1);
}

/* ========================================
   SEARCH BAR
   ======================================== */
.search-bar {
    position: relative;
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: all var(--transition-fast);
}

.search-bar input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--purple-glow);
}

.search-bar .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

/* ========================================
   TOOLBAR
   ======================================== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Color picker for notes */
.color-picker {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
}

.color-dot:hover, .color-dot.active {
    transform: scale(1.2);
    border-color: white;
}

.color-dot.c-purple { background: var(--purple); }
.color-dot.c-cyan { background: var(--cyan); }
.color-dot.c-pink { background: var(--pink); }
.color-dot.c-green { background: var(--green); }
.color-dot.c-orange { background: var(--orange); }

/* ========================================
   AI CHAT
   ======================================== */
.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-welcome {
    text-align: center;
    padding: 40px 20px;
    margin: auto 0;
}

.ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 500px;
    margin: 0 auto;
}

.ai-suggestion {
    padding: 8px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ai-suggestion:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--purple);
    color: var(--purple);
    transform: translateY(-2px);
}

.ai-message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: slideUp 0.3s ease;
}

.ai-message.user {
    align-self: flex-start;
    flex-direction: row;
}

.ai-message.assistant {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.ai-message.assistant .ai-message-avatar {
    background: var(--gradient-primary);
    border: none;
}

.ai-message-content {
    flex: 1;
    min-width: 0;
}

.ai-message-bubble {
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.7;
    word-break: break-word;
}

.ai-message.user .ai-message-bubble {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-top-right-radius: 4px;
}

.ai-message.assistant .ai-message-bubble {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-top-left-radius: 4px;
}

.ai-typing {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 16px 20px !important;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--purple);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.ai-chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--border-glass);
    background: var(--bg-secondary);
}

.ai-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.ai-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 120px;
    line-height: 1.5;
    transition: border-color var(--transition-fast);
}

.ai-input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--purple-glow);
}

.ai-input::placeholder {
    color: var(--text-muted);
}

.ai-send-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    box-shadow: var(--shadow-glow-purple);
}

.ai-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px var(--purple-glow);
}

.ai-input-footer {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: flex-start;
}

/* ========================================
   HABIT HEATMAP
   ======================================== */
.habit-heatmap {
    margin-top: 24px;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 18px);
    gap: 3px;
    direction: ltr;
}

.heatmap-cell {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    transition: all var(--transition-fast);
    cursor: default;
}

.heatmap-cell:hover {
    border-color: var(--border-glass-hover);
    transform: scale(1.3);
}

.heatmap-cell.level-1 { background: rgba(139, 92, 246, 0.2); border-color: rgba(139, 92, 246, 0.15); }
.heatmap-cell.level-2 { background: rgba(139, 92, 246, 0.4); border-color: rgba(139, 92, 246, 0.3); }
.heatmap-cell.level-3 { background: rgba(139, 92, 246, 0.6); border-color: rgba(139, 92, 246, 0.5); }
.heatmap-cell.level-4 { background: rgba(139, 92, 246, 0.85); border-color: rgba(139, 92, 246, 0.7); }

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-muted);
    direction: ltr;
}

.heatmap-months {
    display: flex;
    gap: 3px;
    margin-bottom: 4px;
    font-size: 10px;
    color: var(--text-muted);
    direction: ltr;
}

/* ========================================
   SCHEDULE TIMELINE
   ======================================== */
.schedule-timeline {
    position: relative;
    padding-right: 10px;
}

.schedule-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    position: relative;
    border-bottom: 1px solid var(--border-glass);
}

.schedule-item:last-child {
    border-bottom: none;
}

.schedule-item.current {
    background: rgba(139, 92, 246, 0.06);
    margin: 0 -16px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border-bottom: none;
}

.schedule-item.done {
    opacity: 0.5;
}

.schedule-item.done .schedule-title {
    text-decoration: line-through;
}

.schedule-time {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 60px;
    text-align: left;
    direction: ltr;
    padding-top: 2px;
}

.schedule-item.current .schedule-time {
    color: var(--purple);
}

.schedule-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.schedule-item.current .schedule-dot {
    box-shadow: 0 0 8px 2px var(--purple-glow);
    animation: pulse 2s infinite;
}

.schedule-content {
    flex: 1;
    min-width: 0;
}

.schedule-title {
    font-size: 14px;
    font-weight: 600;
}

.schedule-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ========================================
   VOICE RECORDER
   ======================================== */
.recorder-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 30px 20px;
}

.record-btn {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid var(--border-glass);
    background: var(--bg-glass);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.record-btn:hover {
    border-color: var(--red);
    background: rgba(239, 68, 68, 0.08);
    transform: scale(1.05);
}

.record-btn.recording {
    border-color: var(--red);
    background: rgba(239, 68, 68, 0.1);
    animation: recordPulse 1.5s infinite;
}

.record-btn-inner {
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.record-btn.recording .record-btn-inner {
    color: var(--red);
}

@keyframes recordPulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.recorder-status {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.recorder-timer {
    font-family: 'Cairo', monospace;
    font-size: 28px;
    font-weight: 700;
    color: var(--red);
    letter-spacing: 2px;
}

.recorder-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 40px;
}

.wave-bar {
    width: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
    animation: waveAnim 0.8s infinite ease-in-out;
}

.wave-bar:nth-child(1) { animation-delay: 0s; height: 10px; }
.wave-bar:nth-child(2) { animation-delay: 0.05s; height: 18px; }
.wave-bar:nth-child(3) { animation-delay: 0.1s; height: 28px; }
.wave-bar:nth-child(4) { animation-delay: 0.15s; height: 14px; }
.wave-bar:nth-child(5) { animation-delay: 0.2s; height: 34px; }
.wave-bar:nth-child(6) { animation-delay: 0.25s; height: 20px; }
.wave-bar:nth-child(7) { animation-delay: 0.3s; height: 38px; }
.wave-bar:nth-child(8) { animation-delay: 0.35s; height: 16px; }
.wave-bar:nth-child(9) { animation-delay: 0.4s; height: 30px; }
.wave-bar:nth-child(10) { animation-delay: 0.45s; height: 12px; }
.wave-bar:nth-child(11) { animation-delay: 0.5s; height: 24px; }
.wave-bar:nth-child(12) { animation-delay: 0.55s; height: 36px; }
.wave-bar:nth-child(13) { animation-delay: 0.6s; height: 18px; }
.wave-bar:nth-child(14) { animation-delay: 0.65s; height: 28px; }
.wave-bar:nth-child(15) { animation-delay: 0.7s; height: 14px; }
.wave-bar:nth-child(16) { animation-delay: 0.75s; height: 32px; }
.wave-bar:nth-child(17) { animation-delay: 0.8s; height: 20px; }
.wave-bar:nth-child(18) { animation-delay: 0.85s; height: 26px; }
.wave-bar:nth-child(19) { animation-delay: 0.9s; height: 12px; }
.wave-bar:nth-child(20) { animation-delay: 0.95s; height: 22px; }

@keyframes waveAnim {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1); }
}

/* Recording Items */
.recording-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-glass);
    transition: all var(--transition-fast);
}

.recording-item:last-child {
    border-bottom: none;
}

.recording-item:hover {
    background: var(--bg-glass);
    margin: 0 -16px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
}

.play-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--border-glass);
    background: var(--bg-glass);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.play-btn:hover {
    border-color: var(--purple);
    background: rgba(139, 92, 246, 0.1);
    transform: scale(1.05);
}

.recording-info {
    flex: 1;
    min-width: 0;
}

.recording-name {
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.recording-name:hover {
    color: var(--purple);
}

.recording-meta {
    display: flex;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

.recording-progress {
    width: 100%;
    height: 4px;
    background: var(--bg-glass);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.recording-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    width: 0%;
    transition: width 0.2s linear;
}

.recording-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ========================================
   PHOTO GALLERY
   ======================================== */
.gallery-dropzone {
    border: 2px dashed var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    margin-bottom: 24px;
    transition: all 0.3s ease;
    min-height: 40px;
}

.gallery-dropzone.dragover {
    border-color: var(--purple);
    background: rgba(139, 92, 246, 0.06);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    border: 1px solid var(--border-glass);
    background: var(--bg-glass);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-item-name {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-item-date {
    font-size: 10px;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
}

.gallery-item-actions {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-actions {
    opacity: 1;
}

.gallery-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.gallery-action-btn:hover {
    background: rgba(0,0,0,0.8);
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-img {
    animation: scaleIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 32px;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: #fff;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.18);
}

.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }

.lightbox-info {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    text-align: center;
}

/* ========================================
   HEALTH & FITNESS
   ======================================== */
.health-input-group {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.health-input-group .form-input {
    flex: 1;
}

.health-history-mini {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-glass);
}

.health-summary-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 180px;
    padding: 24px;
    gap: 8px;
}

.health-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
}

.health-bar-track {
    width: 24px;
    flex: 1;
    background: var(--bg-glass);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.health-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: 12px;
    transition: height 1s ease-out;
}

.health-bar-fill.green {
    background: var(--gradient-primary); /* Uses the primary gradient instead of hardcoded green to match theme */
}

.health-bar-label {
    font-size: 11px;
    color: var(--text-muted);
}

@keyframes scaleIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ========================================
   MOBILE RESPONSIVENESS
   ======================================== */
.mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    font-size: 28px;
    z-index: 999;
    box-shadow: var(--shadow-md), var(--shadow-glow-purple);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.mobile-menu-btn:active {
    transform: scale(0.9);
}

@media (max-width: 768px) {
    /* Show mobile floating button */
    .mobile-menu-btn {
        display: flex;
    }

    /* Sidebar off-canvas */
    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px !important;
        height: 100vh;
        z-index: 1001;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -5px 0 25px rgba(0,0,0,0.5);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Reset collapsed state styles on mobile */
    .sidebar.collapsed .logo-text,
    .sidebar.collapsed .user-info,
    .sidebar.collapsed .nav-label,
    .sidebar.collapsed .quote-widget {
        opacity: 1 !important;
        visibility: visible !important;
        width: auto !important;
    }

    /* Hide desktop toggle */
    .sidebar-toggle {
        display: none;
    }

    /* Main Content Adjustments */
    .main-content {
        margin-right: 0 !important;
    }

    .page-container {
        padding: 20px 16px;
        padding-bottom: 100px; /* Space for FAB */
    }

    /* Layout Grids */
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Headers and Toolbars */
    .toolbar, .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .toolbar > div {
        width: 100%;
        justify-content: space-between;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }

    /* Modules specifics */
    .goal-actions, .note-actions {
        flex-direction: column;
    }
    
    .goal-actions input, 
    .goal-actions select, 
    .goal-actions button {
        width: 100%;
    }

    /* Fix Heatmap scroll on mobile */
    .heatmap-container {
        overflow-x: auto;
        padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
    }

    .heatmap-grid {
        min-width: 600px;
    }

    /* Fix Calendar */
    .calendar-days {
        grid-template-columns: repeat(7, minmax(35px, 1fr));
        gap: 4px;
    }
    
    .calendar-day-header {
        font-size: 11px;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 4px;
    }

    .calendar-day-num {
        font-size: 12px;
    }

    /* AI Chat */
    .ai-chat-container {
        height: 65vh;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    .filter-btn {
        flex: 1;
        text-align: center;
        justify-content: center;
    }

    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        text-align: center;
        justify-content: center;
    }
}

/* ========================================
   GAMIFICATION TOAST
   ======================================== */
.gamification-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--bg-card);
    border: 1px solid var(--border-glass-hover);
    padding: 12px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
    backdrop-filter: blur(12px);
}

.gamification-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.gamification-toast.level-up {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(236, 72, 153, 0.9));
    border: none;
    padding: 16px 24px;
    border-radius: var(--radius-md);
}

.gamification-toast .toast-icon {
    font-size: 24px;
}

.gamification-toast .toast-title {
    font-weight: 800;
    font-size: 16px;
    color: var(--text-primary);
}

.gamification-toast .toast-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.level-up .toast-title, .level-up .toast-text {
    color: white;
}

/* ========================================
   MOOD HEATMAP
   ======================================== */
.mood-heatmap-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.mood-heatmap {
    display: grid;
    grid-template-rows: repeat(7, 1fr);
    grid-auto-flow: column;
    grid-auto-columns: 14px;
    gap: 4px;
}

.mood-box {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    cursor: pointer;
    position: relative;
}

.mood-box:hover {
    transform: scale(1.3);
    z-index: 10;
}

/* Tooltip for mood box */
.mood-box:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    border: 1px solid var(--border-glass-hover);
    box-shadow: var(--shadow-md);
    pointer-events: none;
    z-index: 20;
}

/* Heatmap Colors (Different from default theme, game-like) */
.mood-box[data-level="0"] { background: var(--bg-glass); }
.mood-box[data-level="1"] { background: #ff4b4b; border-color: #ff4b4b; box-shadow: 0 0 5px rgba(255,75,75,0.3); } /* 😫 Bad */
.mood-box[data-level="2"] { background: #fa9e3b; border-color: #fa9e3b; box-shadow: 0 0 5px rgba(250,158,59,0.3); } /* 😞 Okay-ish */
.mood-box[data-level="3"] { background: #facc15; border-color: #facc15; box-shadow: 0 0 5px rgba(250,204,21,0.3); } /* 😐 Neutral */
.mood-box[data-level="4"] { background: #4ade80; border-color: #4ade80; box-shadow: 0 0 5px rgba(74,222,128,0.3); } /* 🙂 Good */
.mood-box[data-level="5"] { background: #06b6d4; border-color: #06b6d4; box-shadow: 0 0 8px rgba(6,182,212,0.5); } /* 🤩 Excellent */

/* ========================================
   ACHIEVEMENTS (GAMING BADGES)
   ======================================== */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
}

.achievement-badge {
    background: var(--bg-card);
    border: 2px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: grayscale(1);
    opacity: 0.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.achievement-badge.unlocked {
    filter: grayscale(0);
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    transform: translateY(-5px);
}

.achievement-badge.unlocked::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.achievement-badge.unlocked:hover::before {
    opacity: 1;
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.badge-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    position: relative;
    z-index: 2;
    background: #1a1a3a;
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.5);
    border: 3px solid #333;
}

/* Game-like Badge Colors */
.achievement-badge.unlocked[data-rarity="common"] .badge-icon-wrapper {
    background: linear-gradient(135deg, #4ade80, #06b6d4);
    box-shadow: 0 0 20px rgba(74,222,128,0.4), inset 0 2px 4px rgba(255,255,255,0.6);
    border-color: #bef264;
}

.achievement-badge.unlocked[data-rarity="rare"] .badge-icon-wrapper {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    box-shadow: 0 0 20px rgba(139,92,246,0.4), inset 0 2px 4px rgba(255,255,255,0.6);
    border-color: #a78bfa;
}

.achievement-badge.unlocked[data-rarity="epic"] .badge-icon-wrapper {
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    box-shadow: 0 0 20px rgba(236,72,153,0.4), inset 0 2px 4px rgba(255,255,255,0.6);
    border-color: #fce7f3;
}

.achievement-badge.unlocked[data-rarity="legendary"] .badge-icon-wrapper {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    box-shadow: 0 0 30px rgba(245,158,11,0.6), inset 0 2px 4px rgba(255,255,255,0.6);
    border-color: #fef3c7;
}

.achievement-badge h4 {
    font-size: 14px;
    font-family: var(--font-heading);
    margin: 0;
    z-index: 2;
}

.achievement-badge p {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 0;
    z-index: 2;
}

/* ========================================
   LIBRARY (BOOKS)
   ======================================== */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.book-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform var(--transition-normal);
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-glass-hover);
}

.book-cover {
    width: 100%;
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.book-cover::after {
    content: '';
    position: absolute;
    left: 10%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255,255,255,0.1);
    box-shadow: -2px 0 4px rgba(0,0,0,0.2);
}

.book-info h4 {
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

.book-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.book-progress span {
    font-size: 11px;
    color: var(--text-muted);
    text-align: left;
}

/* ========================================
   STARRED WISHLIST ITEM
   ======================================== */
.wishlist-star-card {
    background: var(--bg-card);
    border: 2px solid var(--purple);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-glow-purple);
    position: relative;
    margin-bottom: 24px;
    transition: all var(--transition-normal);
}

@media (min-width: 768px) {
    .wishlist-star-card {
        flex-direction: row;
        align-items: center;
    }
}

.wishlist-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #111;
    border-bottom: 1px solid var(--border-glass);
}

@media (min-width: 768px) {
    .wishlist-image {
        width: 45%;
        height: 280px;
        border-bottom: none;
        border-left: 1px solid var(--border-glass);
    }
}

.wishlist-star-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wishlist-star-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.wishlist-star-title {
    font-size: 24px;
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.wishlist-star-target {
    font-size: 14px;
    color: var(--text-secondary);
}

/* HALF CIRCLE GAUGE */
.gauge-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 16px;
    width: 100%;
}

.gauge-svg {
    width: 220px;
    height: 110px;
    overflow: visible;
}

.gauge-bg {
    fill: none;
    stroke: var(--bg-glass);
    stroke-width: 16;
    stroke-linecap: round;
}

.gauge-fill {
    fill: none;
    stroke: url(#gauge-gradient);
    stroke-width: 16;
    stroke-linecap: round;
    stroke-dasharray: 314; /* Pi * 100 approx */
    stroke-dashoffset: 314;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.gauge-text {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.gauge-pct {
    font-size: 32px;
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.gauge-label {
    font-size: 13px;
    color: var(--text-muted);
}
