/* 
   Synapse - Apple-Style Minimalist UI
   Inspired by Apple's Human Interface Guidelines
   Clean, functional, accessible
*/

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

/* ==================== ROOT VARIABLES ==================== */

:root {
    /* Light Mode Colors (Default) */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F7;
    --bg-tertiary: #E5E5EA;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --text-tertiary: #AEAEB2;

    /* Accent Colors */
    --accent-blue: #007AFF;
    --accent-blue-hover: #0051D5;
    --accent-green: #34C759;
    --accent-red: #FF3B30;
    --accent-orange: #FF9500;
    --accent-yellow: #FFCC00;
    --accent-purple: #AF52DE;

    /* Borders & Shadows */
    --border-light: #D1D1D6;
    --border-medium: #C7C7CC;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1C1C1E;
    --bg-tertiary: #2C2C2E;
    --text-primary: #FFFFFF;
    --text-secondary: #AEAEB2;
    --text-tertiary: #8E8E93;
    --border-light: #38383A;
    --border-medium: #48484A;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
}

/* ==================== ACCENT COLOR THEMES ==================== */

[data-accent="purple"] {
    --accent-blue: #AF52DE;
    --accent-blue-hover: #9340C1;
}

[data-accent="red"] {
    --accent-blue: #FF3B30;
    --accent-blue-hover: #D9322A;
}

[data-accent="orange"] {
    --accent-blue: #FF9500;
    --accent-blue-hover: #D97F00;
}

[data-accent="green"] {
    --accent-blue: #34C759;
    --accent-blue-hover: #2AA248;
}

[data-accent="pink"] {
    --accent-blue: #FF2D55;
    --accent-blue-hover: #D92547;
}

[data-accent="teal"] {
    --accent-blue: #5AC8FA;
    --accent-blue-hover: #4AA8D4;
}

/* ==================== FONT SIZE VARIANTS ==================== */

[data-fontsize="small"] body {
    font-size: 14px;
}

[data-fontsize="small"] h1 { font-size: 1.75rem; }
[data-fontsize="small"] h2 { font-size: 1.35rem; }
[data-fontsize="small"] h3 { font-size: 1.1rem; }
[data-fontsize="small"] .stat-value { font-size: 1.5rem; }

[data-fontsize="large"] body {
    font-size: 18px;
}

[data-fontsize="large"] h1 { font-size: 2.5rem; }
[data-fontsize="large"] h2 { font-size: 1.85rem; }
[data-fontsize="large"] h3 { font-size: 1.45rem; }
[data-fontsize="large"] .stat-value { font-size: 2.25rem; }

/* ==================== LAYOUT MODE ==================== */

[data-layout="compact"] .container {
    max-width: 1100px;
}

[data-layout="compact"] .card,
[data-layout="compact"] .glass-card,
[data-layout="compact"] .glass-panel {
    padding: var(--spacing-sm) var(--spacing-md);
}

[data-layout="compact"] .navbar {
    padding: 6px 0;
}

[data-layout="compact"] .stats-grid,
[data-layout="compact"] .results-grid {
    gap: var(--spacing-sm);
}

[data-layout="compact"] section,
[data-layout="compact"] .dashboard-section {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
}

[data-layout="compact"] .result-card {
    padding: var(--spacing-sm) var(--spacing-md);
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

::selection {
    background-color: var(--accent-blue);
    color: white;
}

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

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

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

h4 {
    font-size: 1.25rem;
    font-weight: 600;
}

h5 {
    font-size: 1rem;
    font-weight: 600;
}

h6 {
    font-size: 0.875rem;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

a:hover {
    opacity: 0.7;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    width: 100%;
}

.container-sm {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ==================== NAVBAR ==================== */

.navbar {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-light);
    height: 48px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

[data-theme="dark"] .navbar {
    background: rgba(28, 28, 30, 0.72);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.navbar-brand {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}
.navbar-brand:hover { opacity: 1; }

.navbar-brand-icon {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-blue), #5856D6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    border: none;
    background: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}
.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
    opacity: 1;
}
.nav-link.active {
    color: var(--accent-blue);
    background: rgba(0, 122, 255, 0.08);
}
.nav-link i { font-size: 13px; }

/* Dropdown */
.nav-dropdown { position: relative; }

.nav-chevron {
    font-size: 9px !important;
    transition: transform 0.2s;
    margin-left: 2px;
}
.nav-dropdown.open .nav-chevron { transform: rotate(180deg); }

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 210px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0,0,0,0.04);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.97);
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    z-index: 1001;
}
[data-theme="dark"] .nav-dropdown-menu {
    background: #2C2C2E;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.06);
}
.nav-dropdown-right { left: auto; right: 0; }

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.nav-dropdown-menu a,
.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    border-radius: 8px;
    transition: background 0.15s;
    text-decoration: none;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.nav-dropdown-menu a:hover,
.nav-dropdown-item:hover {
    background: var(--bg-secondary);
    opacity: 1;
}
.nav-dropdown-menu a.active {
    color: var(--accent-blue);
    background: rgba(0, 122, 255, 0.08);
}
.nav-dropdown-menu a i,
.nav-dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}
.nav-dropdown-menu a.active i { color: var(--accent-blue); }

.nav-dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 8px;
}

.nav-logout {
    color: #FF3B30 !important;
}
.nav-logout i { color: #FF3B30 !important; }

/* User avatar in nav */
.nav-user-btn { gap: 8px; }
.nav-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), #5856D6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.nav-username {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== BUTTONS ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    outline: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-blue-hover);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.btn-success {
    background-color: var(--accent-green);
    color: white;
}

.btn-danger {
    background-color: var(--accent-red);
    color: white;
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius-full);
}

/* ==================== INPUTS ==================== */

.input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 16px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

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

.input-group {
    position: relative;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.input-group .input {
    padding-left: 44px;
}

/* ==================== CARDS ==================== */

.card {
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.card-body {
    color: var(--text-secondary);
}

/* ==================== BADGES ==================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-blue {
    background-color: rgba(0, 122, 255, 0.1);
    color: var(--accent-blue);
}

.badge-green {
    background-color: rgba(52, 199, 89, 0.1);
    color: var(--accent-green);
}

.badge-red {
    background-color: rgba(255, 59, 48, 0.1);
    color: var(--accent-red);
}

.badge-orange {
    background-color: rgba(255, 149, 0, 0.1);
    color: var(--accent-orange);
}

.badge-gray {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* ==================== MODALS ==================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: var(--spacing-lg);
}

.modal {
    background-color: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
}

/* ==================== TABLES ==================== */

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 var(--spacing-xs);
}

.table thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: var(--spacing-md);
    background-color: transparent;
}

.table tbody tr {
    background-color: var(--bg-primary);
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background-color: var(--bg-secondary);
}

.table tbody td {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.table tbody td:first-child {
    border-left: 1px solid var(--border-light);
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

.table tbody td:last-child {
    border-right: 1px solid var(--border-light);
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

/* ==================== UTILITIES ==================== */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.font-bold {
    font-weight: 700;
}

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

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

.text-sm {
    font-size: 14px;
}

.text-xs {
    font-size: 12px;
}

.text-lg {
    font-size: 18px;
}

.text-xl {
    font-size: 20px;
}

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

.text-secondary {
    color: var(--text-secondary);
}

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

.text-blue {
    color: var(--accent-blue);
}

.text-green {
    color: var(--accent-green);
}

.text-red {
    color: var(--accent-red);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-xs {
    gap: var(--spacing-xs);
}

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.gap-lg {
    gap: var(--spacing-lg);
}

.gap-xl {
    gap: var(--spacing-xl);
}

.mt-xs {
    margin-top: var(--spacing-xs);
}

.mt-sm {
    margin-top: var(--spacing-sm);
}

.mt-md {
    margin-top: var(--spacing-md);
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mt-xl {
    margin-top: var(--spacing-xl);
}

.mb-xs {
    margin-bottom: var(--spacing-xs);
}

.mb-sm {
    margin-bottom: var(--spacing-sm);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.mb-xl {
    margin-bottom: var(--spacing-xl);
}

.p-xs {
    padding: var(--spacing-xs);
}

.p-sm {
    padding: var(--spacing-sm);
}

.p-md {
    padding: var(--spacing-md);
}

.p-lg {
    padding: var(--spacing-lg);
}

.p-xl {
    padding: var(--spacing-xl);
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.rounded-sm {
    border-radius: var(--radius-sm);
}

.rounded-md {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-xl {
    border-radius: var(--radius-xl);
}

.rounded-full {
    border-radius: var(--radius-full);
}

/* ==================== GRID SYSTEM ==================== */

.grid {
    display: grid;
    gap: var(--spacing-md);
}

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

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

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {

    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {

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

/* ==================== HAMBURGER MENU ==================== */

.navbar-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background 0.2s;
    z-index: 1002;
}
.navbar-hamburger:hover { background: var(--bg-tertiary); }
.navbar-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}
.navbar-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.navbar-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.navbar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}
.navbar-overlay.open { display: block; opacity: 1; }

body.nav-open { overflow: hidden; }

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

@media (max-width: 768px) {
    body { font-size: 15px; }
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.35rem; }
    h3 { font-size: 1.15rem; }
    .container { padding: 0 var(--spacing-md); }

    /* Show hamburger */
    .navbar-hamburger { display: flex; }

    /* Slide-in menu */
    .navbar-menu {
        position: fixed;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100vh;
        background: var(--bg-primary);
        border-left: 1px solid var(--border-light);
        z-index: 1001;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        padding: 60px 0 24px;
        box-shadow: -8px 0 30px rgba(0,0,0,0.15);
    }
    [data-theme="dark"] .navbar-menu {
        background: rgba(28, 28, 30, 0.98);
        box-shadow: -8px 0 30px rgba(0,0,0,0.4);
    }
    .navbar-menu.open { right: 0; }

    .navbar-nav {
        flex-direction: column;
        gap: 0;
        padding: 0;
    }
    .navbar-nav > li { width: 100%; }

    .nav-link {
        padding: 14px 24px;
        font-size: 15px;
        border-radius: 0;
        border-bottom: 1px solid var(--border-light);
        width: 100%;
    }
    .nav-link i { width: 20px; text-align: center; color: var(--accent-blue); }

    /* Mobile dropdowns: inline expand instead of absolute */
    .nav-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background: var(--bg-secondary);
    }
    [data-theme="dark"] .nav-dropdown-menu {
        background: var(--bg-secondary);
        box-shadow: none;
    }
    .nav-dropdown.open .nav-dropdown-menu {
        max-height: 500px;
    }
    .nav-dropdown-menu a,
    .nav-dropdown-item {
        padding: 12px 24px 12px 48px;
        font-size: 14px;
        border-radius: 0;
        border-bottom: 1px solid var(--border-light);
    }

    /* User menu mobile */
    .nav-user-menu {
        border-top: 2px solid var(--border-light);
        margin-top: 4px;
    }

    /* Grids */
    .grid-cols-2, .grid-cols-3, .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid-cols-3, .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== GLOBAL TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 400px;
    width: calc(100% - 40px);
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.toast.toast--visible {
    transform: translateX(0);
    opacity: 1;
}

.toast.toast--exit {
    transform: translateX(120%);
    opacity: 0;
    margin-top: -60px;
    transition: all 0.35s cubic-bezier(0.55, 0, 1, 0.45), margin-top 0.3s 0.1s ease;
}

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.toast--success .toast-icon { background: rgba(52, 199, 89, 0.15); color: #34C759; }
.toast--error .toast-icon { background: rgba(255, 59, 48, 0.15); color: #FF3B30; }
.toast--warning .toast-icon { background: rgba(255, 149, 0, 0.15); color: #FF9500; }
.toast--info .toast-icon { background: rgba(0, 122, 255, 0.15); color: #007AFF; }

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 1px;
    text-transform: capitalize;
}

.toast-message {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    opacity: 0;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast:hover .toast-close {
    opacity: 1;
}

.toast-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 16px 16px;
    transition: width linear;
}

.toast--success .toast-progress { background: #34C759; }
.toast--error .toast-progress { background: #FF3B30; }
.toast--warning .toast-progress { background: #FF9500; }
.toast--info .toast-progress { background: #007AFF; }

[data-theme="dark"] .toast {
    box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.2);
}

@media (max-width: 480px) {
    .toast-container {
        top: auto;
        bottom: 20px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }
    .toast {
        transform: translateY(120%);
    }
    .toast.toast--visible {
        transform: translateY(0);
    }
    .toast.toast--exit {
        transform: translateY(120%);
        margin-top: 0;
        margin-bottom: -60px;
    }
}