/* Life Assistant - Liquid Glass Design System */

/* ============================================
   CSS VARIABLES & DESIGN TOKENS
   ============================================ */

:root {
    /* Primary Colors - Emerald/Teal/Cyan Palette */
    --emerald-600: #059669;
    --emerald-500: #10B981;
    --teal-600: #0D9488;
    --teal-500: #14B8A6;
    --blue-600: #2563EB;
    --blue-500: #3B82F6;
    --cyan-600: #0891B2;
    --cyan-500: #06B6D4;
    --violet-500: #8B5CF6;
    --pink-500: #EC4899;
    --rose-500: #F43F5E;
    --amber-500: #F59E0B;

    /* Glass & Transparency */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --glass-blur: blur(16px);

    /* Background Gradients */
    /* A rich, dynamic gradient that looks good through glass */
    --bg-gradient: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    --bg-mesh: radial-gradient(at 40% 20%, hsla(168, 76%, 85%, 1) 0px, transparent 50%),
        radial-gradient(at 80% 0%, hsla(189, 100%, 90%, 1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(340, 100%, 96%, 1) 0px, transparent 50%),
        radial-gradient(at 80% 50%, hsla(240, 100%, 96%, 1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(220, 100%, 96%, 1) 0px, transparent 50%),
        radial-gradient(at 80% 100%, hsla(240, 100%, 96%, 1) 0px, transparent 50%),
        radial-gradient(at 0% 0%, hsla(340, 100%, 96%, 1) 0px, transparent 50%);

    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-tertiary: #9CA3AF;

    /* Spacing Scale */
    --space-xs: 0.25rem;
    /* 4px */
    --space-sm: 0.5rem;
    /* 8px */
    --space-md: 0.75rem;
    /* 12px */
    --space-lg: 1rem;
    /* 16px */
    --space-xl: 1.5rem;
    /* 24px */
    --space-2xl: 2rem;
    /* 32px */

    /* Border Radius */
    --radius-sm: 0.75rem;
    /* 12px - Softer corners */
    --radius-md: 1rem;
    /* 16px */
    --radius-lg: 1.5rem;
    /* 24px */
    --radius-xl: 2rem;
    /* 32px */
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    background-color: #F3F4F6;
    background-image: var(--bg-mesh);
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    /* Prevent body scroll, handle in containers */
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--emerald-600) 0%, var(--teal-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-bottom: 0.1em;
    /* Prevent descender clipping */
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.25rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.text-muted {
    color: var(--text-tertiary);
}

/* ============================================
   LAYOUT STRUCTURE
   ============================================ */

.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ============================================
   GLASS SIDEBAR
   ============================================ */

.sidebar {
    width: 20rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--glass-border);
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    z-index: 20;
    height: 100vh;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
    text-decoration: none;
    padding: 0 var(--space-xs);
}

.logo-icon {
    width: 2.75rem;
    height: 2.75rem;
    background: linear-gradient(135deg, var(--emerald-500), var(--teal-500));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.logo-text h1 {
    font-size: 1.125rem;
    margin: 0;
    background: none;
    -webkit-text-fill-color: var(--text-primary);
    color: var(--text-primary);
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin: 0;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    flex: 1;
    overflow-y: auto;
    padding-right: var(--space-xs);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--emerald-600);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.9);
    color: var(--emerald-600);
    box-shadow: var(--shadow-sm);
    border-color: rgba(255, 255, 255, 0.8);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--emerald-600);
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.sidebar-link-logout:hover {
    color: var(--rose-500);
    background: rgba(244, 63, 94, 0.1);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--emerald-400), var(--cyan-400));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */

.main-content {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    padding: var(--space-2xl);
    position: relative;
    scroll-behavior: smooth;
}

.header {
    margin-bottom: var(--space-2xl);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
    z-index: 10;
}

.header-left h1 {
    margin-bottom: var(--space-xs);
}

.header-left p {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* ============================================
   GLASS CARDS & CONTAINERS
   ============================================ */

.card,
.battle-card,
.stat-card,
.hero-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    padding: var(--space-xl);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.card:hover,
.battle-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.75);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Hero Card Special Styling */
.hero-card {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.9), rgba(59, 130, 246, 0.9));
    color: white;
    border: none;
}

.hero-card h2 {
    color: white;
    margin-bottom: var(--space-sm);
}

.hero-card p {
    color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   GRID SYSTEMS
   ============================================ */

.dashboard-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: var(--space-xl);
    max-width: 1600px;
    margin: 0 auto;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-xl);
    max-width: 1600px;
    margin: 0 auto;
}

.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* ============================================
   INTERACTIVE ELEMENTS
   ============================================ */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--emerald-500), var(--teal-600));
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
    filter: brightness(1.05);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-secondary);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: white;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn-danger {
    background: linear-gradient(135deg, var(--rose-500), #E11D48);
    color: white;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.25);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(244, 63, 94, 0.35);
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.icon-btn:hover {
    background: white;
    color: var(--emerald-600);
    transform: scale(1.05);
}

/* List Items */
.info-item,
.todo-item,
.response-item {
    padding: var(--space-lg);
    background: rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    transition: all 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.info-item:hover,
.todo-item:hover,
.response-item:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(4px);
    border-color: rgba(16, 185, 129, 0.2);
    box-shadow: var(--shadow-sm);
}

.info-subject {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.info-snippet {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.info-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: flex;
    gap: var(--space-md);
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.status-open {
    background: rgba(245, 158, 11, 0.15);
    color: #B45309;
}

.status-done {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.status-urgent {
    background: rgba(244, 63, 94, 0.15);
    color: #BE123C;
}

/* ============================================
   MODALS & OVERLAYS
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-tertiary);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    background: white;
    border-color: var(--emerald-500);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* ============================================
   SCROLLBARS
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* ============================================
   UTILITIES & ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.hidden {
    display: none !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        box-shadow: 10px 0 20px rgba(0, 0, 0, 0.1);
    }

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

    .main-content {
        width: 100%;
        padding: var(--space-lg);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

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

    .two-column {
        grid-template-columns: 1fr;
    }

    .hamburger-menu {
        display: flex;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 100;
        background: white;
        padding: 0.5rem;
        border-radius: var(--radius-md);
    }
}

/* ============================================
   SETUP WIZARD
   ============================================ */

.setup-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.setup-header {
    text-align: center;
    margin-bottom: 3rem;
}

.setup-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3rem;
}

.progress-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.progress-step.active {
    background: var(--emerald-500);
    color: white;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
    border-color: transparent;
}

.progress-line {
    width: 60px;
    height: 2px;
    background: rgba(0, 0, 0, 0.05);
    margin: 0 10px;
}

.wizard-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.wizard-step.active {
    display: block;
}

.autonomy-options {
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
}

.autonomy-card {
    cursor: pointer;
    display: block;
}

.autonomy-card input {
    display: none;
}

.autonomy-card .card-content {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.autonomy-card input:checked+.card-content {
    border-color: var(--emerald-500);
    background: white;
    box-shadow: var(--shadow-md);
}

.autonomy-card .icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    color: var(--emerald-600);
}

.autonomy-card h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.autonomy-card p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.wizard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}