/* ═══════════════════════════════════════════════════════════
   AddEverything — Design System
   Modern, mobile-first, device-responsive dark/light mode
   ═══════════════════════════════════════════════════════════ */

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

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    min-height: 100dvh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

img, video {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ─── Light Theme (Default) ──────────────────────────── */
:root {
    --clr-bg:            #F8FAFC;
    --clr-bg-secondary:  #F1F5F9;
    --clr-surface:       #FFFFFF;
    --clr-surface-hover: #F8FAFC;
    --clr-border:        #E2E8F0;
    --clr-border-focus:  #3B82F6;
    --clr-text:          #0F172A;
    --clr-text-secondary:#64748B;
    --clr-text-muted:    #94A3B8;

    --clr-primary:       #3B82F6;
    --clr-primary-hover: #2563EB;
    --clr-primary-light: #DBEAFE;
    --clr-primary-glow:  rgba(59, 130, 246, 0.15);

    --clr-accent:        #8B5CF6;
    --clr-accent-hover:  #7C3AED;

    --clr-success:       #10B981;
    --clr-success-light: #D1FAE5;
    --clr-warning:       #F59E0B;
    --clr-warning-light: #FEF3C7;
    --clr-danger:        #EF4444;
    --clr-danger-light:  #FEE2E2;
    --clr-info:          #06B6D4;
    --clr-info-light:    #CFFAFE;

    --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md:  0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg:  0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl:  0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px var(--clr-primary-glow);

    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --radius-xl:  24px;
    --radius-full: 9999px;

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-blur: blur(12px);
}

/* ─── Dark Theme ─────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    :root {
        --clr-bg:            #0B1120;
        --clr-bg-secondary:  #111827;
        --clr-surface:       #1E293B;
        --clr-surface-hover: #334155;
        --clr-border:        #334155;
        --clr-border-focus:  #3B82F6;
        --clr-text:          #F1F5F9;
        --clr-text-secondary:#94A3B8;
        --clr-text-muted:    #64748B;

        --clr-primary-light: rgba(59, 130, 246, 0.15);
        --clr-success-light: rgba(16, 185, 129, 0.15);
        --clr-warning-light: rgba(245, 158, 11, 0.15);
        --clr-danger-light:  rgba(239, 68, 68, 0.15);
        --clr-info-light:    rgba(6, 182, 212, 0.15);

        --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md:  0 4px 6px -1px rgba(0, 0, 0, 0.4);
        --shadow-lg:  0 10px 15px -3px rgba(0, 0, 0, 0.4);
        --shadow-xl:  0 20px 25px -5px rgba(0, 0, 0, 0.5);
        --shadow-glow: 0 0 30px var(--clr-primary-glow);

        --glass-bg: rgba(30, 41, 59, 0.7);
        --glass-border: rgba(51, 65, 85, 0.5);
    }
}

/* ─── Body ───────────────────────────────────────────── */
body {
    background: var(--clr-bg);
    color: var(--clr-text);
}

/* ─── Typography ─────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 4vw, 1.875rem); }
h3 { font-size: clamp(1.125rem, 3vw, 1.5rem); }

.text-gradient {
    background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Layout ─────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .container { padding: 0 2rem; }
}

/* ─── Animated Background ────────────────────────────── */
.bg-pattern {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.bg-pattern .shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    animation: float 20s ease-in-out infinite;
}

.bg-pattern .shape:nth-child(1) {
    width: 300px; height: 300px;
    background: var(--clr-primary);
    top: -50px; right: -50px;
    animation-duration: 25s;
}

.bg-pattern .shape:nth-child(2) {
    width: 200px; height: 200px;
    background: var(--clr-accent);
    bottom: 20%; left: -30px;
    animation-duration: 18s;
    animation-delay: -5s;
}

.bg-pattern .shape:nth-child(3) {
    width: 150px; height: 150px;
    background: var(--clr-success);
    top: 40%; right: 10%;
    animation-duration: 22s;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(30px, -30px) scale(1.05); }
    50%      { transform: translate(-20px, 20px) scale(0.95); }
    75%      { transform: translate(15px, 15px) scale(1.02); }
}

/* ─── Cards ──────────────────────────────────────────── */
.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);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), box-shadow var(--transition);
}

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

.card-solid {
    background: var(--clr-surface);
    backdrop-filter: none;
    border: 1px solid var(--clr-border);
}

/* ─── Buttons ────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.btn:hover::after {
    opacity: 1;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-hover));
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--clr-surface);
    color: var(--clr-text);
    border: 1px solid var(--clr-border);
}

.btn-secondary:hover {
    background: var(--clr-surface-hover);
    border-color: var(--clr-primary);
}

.btn-danger {
    background: linear-gradient(135deg, var(--clr-danger), #DC2626);
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-success {
    background: linear-gradient(135deg, var(--clr-success), #059669);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-ghost {
    background: transparent;
    color: var(--clr-text-secondary);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: var(--clr-primary-light);
    color: var(--clr-primary);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading spinner inside button */
.btn .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Inputs ─────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--clr-surface);
    border: 1.5px solid var(--clr-border);
    border-radius: var(--radius-md);
    color: var(--clr-text);
    font-size: 0.9375rem;
    transition: all var(--transition);
    outline: none;
}

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

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

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

.form-help {
    font-size: 0.8125rem;
    color: var(--clr-text-muted);
    margin-top: 0.375rem;
}

.form-error {
    font-size: 0.8125rem;
    color: var(--clr-danger);
    margin-top: 0.375rem;
    display: none;
}

.form-group.has-error .form-input,
.form-group.has-error .form-textarea {
    border-color: var(--clr-danger);
}

.form-group.has-error .form-error {
    display: block;
}

/* ─── Character Counter ──────────────────────────────── */
.char-counter {
    display: flex;
    justify-content: flex-end;
    font-size: 0.8125rem;
    color: var(--clr-text-muted);
    margin-top: 0.25rem;
    transition: color var(--transition);
}

.char-counter.warning {
    color: var(--clr-warning);
}

.char-counter.danger {
    color: var(--clr-danger);
    font-weight: 600;
}

/* ─── Badges ─────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-primary { background: var(--clr-primary-light); color: var(--clr-primary); }
.badge-success { background: var(--clr-success-light); color: var(--clr-success); }
.badge-warning { background: var(--clr-warning-light); color: var(--clr-warning); }
.badge-danger  { background: var(--clr-danger-light);  color: var(--clr-danger); }
.badge-info    { background: var(--clr-info-light);    color: var(--clr-info); }

/* ─── Toast Notifications ────────────────────────────── */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    font-weight: 500;
    max-width: 400px;
    animation: toastIn 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    transition: all 0.3s ease;
}

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

.toast-success { border-left: 4px solid var(--clr-success); }
.toast-error   { border-left: 4px solid var(--clr-danger); }
.toast-warning { border-left: 4px solid var(--clr-warning); }
.toast-info    { border-left: 4px solid var(--clr-info); }

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--clr-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    transition: color var(--transition);
}

.toast-close:hover {
    color: var(--clr-text);
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(100%); opacity: 0; }
}

/* ─── Lockdown Banner ────────────────────────────────── */
.lockdown-banner {
    background: linear-gradient(135deg, var(--clr-warning), #D97706);
    color: #fff;
    padding: 0.875rem 1.25rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    animation: pulse-bg 3s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

/* ─── Modal ──────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 480px;
    width: 100%;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: var(--shadow-xl);
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

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

/* ─── Page Transitions ───────────────────────────────── */
.page-enter {
    animation: pageEnter 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

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

/* ─── Utility Classes ────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 480px) {
    .toast-container {
        left: 0.5rem;
        right: 0.5rem;
    }
    .toast {
        max-width: 100%;
    }
    .modal {
        padding: 1.5rem;
    }
    .modal-actions {
        flex-direction: column;
    }
    .modal-actions .btn {
        width: 100%;
    }
}
