/* ═══════════════════════════════════════════════════════════════════════════
   CELNOTE - Futuristic Premium Theme
   ═══════════════════════════════════════════════════════════════════════════ */

/* --- Google Fonts (Modern Outfit + Space Grotesk) --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ═══════════════════════════════════════════════════════════════════════════
   CSS VARIABLES - Light Theme (Default)
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
    /* === Core Brand Colors === */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);

    /* === Accent Neon Colors === */
    --accent-cyan: #22d3ee;
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    --accent-emerald: #10b981;

    /* === Gradients === */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-accent: linear-gradient(135deg, #22d3ee 0%, #6366f1 100%);
    --gradient-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(168, 85, 247, 0.4) 100%);
    --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.95) 100%);

    /* === Status Colors === */
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #0ea5e9;

    /* === Text Colors === */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-on-primary: #ffffff;
    --text-light: #f1f5f9;

    /* === Background Colors === */
    --bg-page: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-solid: #ffffff;
    --bg-input: rgba(248, 250, 252, 0.9);
    --bg-hover: rgba(99, 102, 241, 0.08);

    /* === Border & Glass === */
    --border-color: rgba(148, 163, 184, 0.3);
    --border-glow: rgba(99, 102, 241, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: blur(20px);

    /* === Shadows === */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
    --shadow-glow-intense: 0 0 40px rgba(99, 102, 241, 0.25);
    --shadow-neon: 0 0 20px rgba(34, 211, 238, 0.3);

    /* === Typography === */
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Space Grotesk', 'Outfit', sans-serif;

    /* === Spacing & Radius === */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* === Transitions === */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ═══════════════════════════════════════════════════════════════════════════
   DARK THEME VARIABLES
   ═══════════════════════════════════════════════════════════════════════════ */
body.dark {
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --primary-light: rgba(129, 140, 248, 0.2);

    --gradient-primary: linear-gradient(135deg, #818cf8 0%, #a855f7 50%, #c084fc 100%);
    --gradient-accent: linear-gradient(135deg, #22d3ee 0%, #818cf8 100%);
    --gradient-glow: linear-gradient(135deg, rgba(129, 140, 248, 0.3) 0%, rgba(168, 85, 247, 0.3) 100%);
    --gradient-card: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-on-primary: #ffffff;

    --bg-page: #0a0f1e;
    --bg-card: rgba(30, 41, 59, 0.75);
    --bg-card-solid: #1e293b;
    --bg-input: rgba(51, 65, 85, 0.6);
    --bg-hover: rgba(129, 140, 248, 0.12);

    --border-color: rgba(71, 85, 105, 0.5);
    --border-glow: rgba(129, 140, 248, 0.6);
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(71, 85, 105, 0.3);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.25), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(129, 140, 248, 0.2);
    --shadow-glow-intense: 0 0 60px rgba(129, 140, 248, 0.35);
    --shadow-neon: 0 0 30px rgba(34, 211, 238, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════════════
   GLOBAL RESET & BASE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    min-height: 100vh;
    transition: background-color var(--transition-slow), color var(--transition-slow);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated Background Gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(34, 211, 238, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

body.dark::before {
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(34, 211, 238, 0.06) 0%, transparent 60%);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════════════ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0 0 0.5em 0;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.1rem;
}

/* Gradient Text Effect for Headings */
.gradient-text,
.card h2 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
    font-weight: 500;
}

a:hover {
    color: var(--primary-dark);
}

hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 1.5rem 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   APP HEADER (Glassmorphism)
   ═══════════════════════════════════════════════════════════════════════════ */
.app-header {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.app-header h1 {
    font-size: 1.25rem;
    margin: 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-header .header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .app-header {
        justify-content: center;
        text-align: center;
    }

    .app-header .header-actions {
        justify-content: center;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTAINER
   ═══════════════════════════════════════════════════════════════════════════ */
.container-fluid {
    max-width: 1280px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS (Glassmorphism Premium)
   ═══════════════════════════════════════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--border-glow);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORM ELEMENTS (Premium Inputs)
   ═══════════════════════════════════════════════════════════════════════════ */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    background: var(--bg-input);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

input[type="file"] {
    padding: 0.5rem;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light), var(--shadow-glow);
    background: var(--bg-card-solid);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS (Futuristic with Glow)
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-on-primary) !important;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

/* Primary Button */
.btn-primary {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow-intense), var(--shadow-lg);
}

/* Danger Button */
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-danger:hover {
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.4), var(--shadow-lg);
}

/* Success Button */
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-success:hover {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.4), var(--shadow-lg);
}

/* Warning Button */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.btn-warning:hover {
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.4), var(--shadow-lg);
}

/* Info Button */
.btn-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.btn-info:hover {
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.4), var(--shadow-lg);
}

/* Secondary Button */
.btn-secondary {
    background: var(--bg-input);
    color: var(--text-secondary) !important;
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary) !important;
}

body.dark .btn-secondary {
    background: var(--bg-input);
    color: var(--text-light) !important;
    border-color: var(--border-color);
}

body.dark .btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary) !important;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.25rem;
    border-radius: var(--radius-full);
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
    transform: rotate(15deg);
    box-shadow: var(--shadow-glow);
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH PAGES (Login, Register, Settings)
   ═══════════════════════════════════════════════════════════════════════════ */
body.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

body.auth-page::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 70% 70%, rgba(168, 85, 247, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.08) 0%, transparent 50%);
    animation: floatBg 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes floatBg {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(2%, 2%) rotate(1deg);
    }

    50% {
        transform: translate(-1%, 3%) rotate(-0.5deg);
    }

    75% {
        transform: translate(-2%, 1%) rotate(0.5deg);
    }
}

.auth-container {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    border-radius: var(--radius-2xl);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.auth-container h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-container form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.auth-container form .actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.auth-container .auth-link {
    display: block;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.auth-container .auth-link:hover {
    color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MESSAGE & ERROR ALERTS
   ═══════════════════════════════════════════════════════════════════════════ */
.message,
.error {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-weight: 500;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.message {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.08) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #047857;
}

.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.08) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

body.dark .message {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
    color: #34d399;
}

body.dark .error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
    color: #fca5a5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS (Glassmorphism)
   ═══════════════════════════════════════════════════════════════════════════ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn var(--transition-fast) ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    padding: 2rem;
    width: 520px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp var(--transition-base) ease-out;
}

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

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

.modal-content .modal-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Drawing Modal */
#drawModal .modal-content {
    width: 95%;
    max-width: 1000px;
}

#drawCanvas {
    width: 100%;
    height: auto;
    background: var(--bg-card-solid);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: crosshair;
    margin-top: 1rem;
}

body.dark #drawCanvas {
    background: #f8fafc;
}

/* Drawing Toolbar */
.draw-toolbar-container {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 1rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.draw-toolbar-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.draw-toolbar-group strong {
    font-size: 0.9rem;
    color: var(--primary);
    margin-right: 0.5rem;
}

.draw-tool-btn,
.color-swatch,
.action-btn,
.delete-btn,
.close-btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    border: none;
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.draw-tool-btn {
    background: var(--text-secondary);
}

.draw-tool-btn.active {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-glow);
}

.action-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.delete-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.close-btn {
    background: #6b7280;
}

.color-palette {
    display: flex;
    gap: 8px;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    border: 3px solid var(--border-color);
    transition: all var(--transition-fast);
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    border-color: var(--primary);
    transform: scale(1.2);
    box-shadow: var(--shadow-glow);
}

/* Note Modal Actions */
#noteModal .modal-actions .btn {
    padding: 0.5rem 1rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ITEM GRIDS (Notes, Files, Projects)
   ═══════════════════════════════════════════════════════════════════════════ */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.note-card,
.file-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.note-card::before,
.file-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.note-card:hover,
.file-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--border-glow);
}

.note-card:hover::before,
.file-card:hover::before {
    opacity: 1;
}

.note-card h4,
.file-card strong {
    margin: 0 0 0.35rem 0;
    font-family: var(--font-heading);
    font-weight: 600;
    word-break: break-word;
    color: var(--text-primary);
}

.note-card small,
.file-card small {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: block;
}

.note-card .note-actions {
    margin-top: 1rem;
}

.note-card .view-btn {
    padding: 0.625rem;
    font-size: 0.875rem;
    width: 100%;
}

.file-card .file-icon {
    font-size: 2.75rem;
    text-align: center;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.file-card .file-actions {
    margin-top: 0.875rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.file-card .file-actions a,
.file-card .file-actions button {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.file-card input[type="checkbox"] {
    width: auto;
    margin-left: auto;
    accent-color: var(--primary);
}

/* Drawing Cards */
.drawing-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    border: 2px solid var(--border-color);
    transition: all var(--transition-base);
}

.drawing-card:hover img {
    border-color: var(--primary);
}

#drawingList .file-card {
    background: var(--bg-card);
}

#drawingList .file-actions a,
#drawingList .file-actions button {
    font-size: 1rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN PANEL STYLES
   ═══════════════════════════════════════════════════════════════════════════ */
.user-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 0.875rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all var(--transition-base);
}

.user-card:hover {
    box-shadow: var(--shadow-md), var(--shadow-glow);
    border-color: var(--border-glow);
}

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

.user-info h4 {
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.user-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.user-actions .btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
}

/* Disk Usage */
#diskUsage .progress-bar {
    margin-top: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
    height: 14px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

#diskUsage .progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    transition: width var(--transition-base);
    border-radius: var(--radius-full);
}

/* Drop Area */
#dropArea {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    text-align: center;
    background: var(--bg-input);
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

#dropArea::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-glow);
    opacity: 0;
    transition: opacity var(--transition-base);
}

#dropArea p {
    font-size: 1.05rem;
    margin: 0;
    position: relative;
    z-index: 1;
}

#dropArea:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

#dropArea:hover::before {
    opacity: 1;
}

/* Preview Cards */
#previewArea .preview-card,
#projectPreviewArea .preview-card {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px;
    background: var(--bg-input);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

#previewArea .preview-card:hover,
#projectPreviewArea .preview-card:hover {
    border-color: var(--primary);
}

#previewArea .preview-card img,
#projectPreviewArea .preview-card img {
    display: block;
    border-radius: var(--radius-sm);
}

#previewArea .preview-text,
#projectPreviewArea .preview-text {
    width: 80px;
    height: 80px;
    font-size: 0.75rem;
    padding: 6px;
    word-break: break-all;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-secondary);
}

.preview-cancel-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    box-shadow: var(--shadow-md);
    z-index: 10;
    transition: all var(--transition-fast);
}

.preview-cancel-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

/* Project Members List */
.member-list-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ROLE BADGES
   ═══════════════════════════════════════════════════════════════════════════ */
.role-badge {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.role-badge small {
    margin-left: 6px;
    opacity: 0.8;
    font-weight: 400;
}

.role-user {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.role-manager {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #b45309;
}

.role-admin {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #dc2626;
}

body.dark .role-manager {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(245, 158, 11, 0.15) 100%);
    color: #fbbf24;
}

body.dark .role-admin {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(239, 68, 68, 0.15) 100%);
    color: #fca5a5;
}

body.dark .role-user {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Role Select Dropdown */
.role-select {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    margin-right: 6px;
    transition: all var(--transition-fast);
}

.role-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

body.dark .role-select {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SWEETALERT FIXES
   ═══════════════════════════════════════════════════════════════════════════ */
.swal2-popup .swal2-input {
    width: auto;
    max-width: 100%;
}

.swal2-popup {
    border-radius: var(--radius-xl) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS & UTILITIES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Fade In Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.card {
    animation: fadeInUp var(--transition-base) ease-out;
    animation-fill-mode: both;
}

.card:nth-child(1) {
    animation-delay: 0.05s;
}

.card:nth-child(2) {
    animation-delay: 0.1s;
}

.card:nth-child(3) {
    animation-delay: 0.15s;
}

.card:nth-child(4) {
    animation-delay: 0.2s;
}

.card:nth-child(5) {
    animation-delay: 0.25s;
}

/* Pulse Animation for Notifications */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

#notificationBadge {
    animation: pulse 2s ease-in-out infinite;
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-input);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-input);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Selection */
::selection {
    background: var(--primary);
    color: var(--text-on-primary);
}

/* Focus Visible */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0 1rem;
        margin: 1rem auto;
    }

    .card {
        padding: 1.25rem;
        border-radius: var(--radius-lg);
    }

    .auth-container {
        padding: 1.75rem;
    }

    .item-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 0.875rem 1rem;
    }

    .app-header h1 {
        font-size: 1.1rem;
    }

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

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE PERFORMANCE OPTIMIZATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* Disable fixed background gradient on mobile - major performance boost */
    body::before {
        position: absolute;
        background-attachment: scroll;
    }

    /* Disable backdrop-filter on header for mobile scroll performance */
    .app-header {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--bg-card-solid);
    }

    /* Disable backdrop-filter on cards */
    .card,
    .user-card,
    .note-card,
    .file-card {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    /* Disable transform animations on mobile */
    .card:hover,
    .note-card:hover,
    .file-card:hover,
    .user-card:hover {
        transform: none;
    }
}

/* iOS Safari specific optimizations */
@supports (-webkit-touch-callout: none) {
    body::before {
        position: absolute;
    }

    .app-header,
    .card,
    .modal-content {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PREMIUM FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */
.app-footer {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    margin-top: 3rem;
    position: relative;
    overflow: hidden;
}

.app-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.app-footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 10% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 20%, rgba(168, 85, 247, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body.dark .app-footer::after {
    background:
        radial-gradient(ellipse at 10% 80%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 20%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 1.5rem;
    position: relative;
    z-index: 1;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section h4::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-glow), transparent);
    margin-left: 0.5rem;
}

.footer-section p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.7;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.footer-links li a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    padding: 0.25rem 0;
    position: relative;
}

.footer-links li a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-base);
}

.footer-links li a:hover {
    color: var(--primary);
    transform: translateX(4px);
}

.footer-links li a:hover::before {
    width: 100%;
}

.footer-socials {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.25rem;
    text-decoration: none;
    transition: all var(--transition-base);
}

.social-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-brand img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.footer-brand-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.footer-copyright {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.footer-copyright a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-copyright a:hover {
    color: var(--primary-dark);
}

.footer-legal-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-legal-links a {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-legal-links a:hover {
    color: var(--primary);
}

@media (max-width: 768px) {
    .footer-container {
        padding: 2rem 1rem 1.25rem;
    }

    .footer-grid {
        gap: 1.5rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-legal-links {
        justify-content: center;
    }

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

    .app-footer {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--bg-card-solid);
    }
}