@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0');

/* Antigravity Design Tokens */
:root {
    --color-primary: #137fec;
    --color-primary-rgb: 19, 127, 236;
    --color-bg-light: #f6f7f8;
    --color-bg-dark: #101922;
    --font-display: 'Manrope', sans-serif;
    --font-lexend: 'Lexend', sans-serif;
}

body {
    font-family: var(--font-display);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.font-lexend {
    font-family: var(--font-lexend);
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Scrollbar Hiding */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Sidebar Tabs - Converted to Pure CSS to avoid @apply issues with CDN */
.sidebar-tab {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    /* gap-3 */
    padding: 0.75rem 1rem;
    /* px-4 py-3 */
    font-size: 0.875rem;
    /* text-sm */
    font-weight: 500;
    /* font-medium */
    transition: all 0.2s ease;
    position: relative;
    border-radius: 0.75rem;
    /* rounded-xl */
    margin: 0 0.5rem 0.25rem 0.5rem;
    /* mx-2 mb-1 */
    cursor: pointer;
}

.sidebar-tab-active {
    background-color: white;
    color: var(--color-primary);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.dark .sidebar-tab-active {
    background-color: #1e293b;
    /* slate-800 */
    color: #38bdf8;
    /* sky-400 or lighter primary */
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.sidebar-tab-inactive {
    color: #4c739a;
}

.sidebar-tab-inactive:hover {
    background-color: #e7edf3;
}

.dark .sidebar-tab-inactive {
    color: #94a3b8;
    /* slate-400 */
}

.dark .sidebar-tab-inactive:hover {
    background-color: rgba(30, 41, 59, 0.5);
    /* slate-800/50 */
}


/* Preview Canvas */
.a4-preview {
    aspect-ratio: 1 / 1.414;
    max-height: 80vh;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    /* shadow-2xl */
    transition: transform 0.3s ease;
}

/* Glassmorphism & Micro-animations */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Gradient Text */
.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-image: linear-gradient(to right, var(--color-primary), #3b82f6);
}

/* Canvas Editor Styles */
#canvas-hover-highlight {
    pointer-events: none;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 0 2px rgba(19, 127, 236, 0.1);
}

#canvas-active-editor {
    animation: editor-pop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    caret-color: #137fec;
}

@keyframes editor-pop {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Floating Control Center */
.control-center {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    border-radius: 1.5rem;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dark .control-center {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

.control-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.dark .control-item {
    color: #94a3b8;
}

.control-item:hover {
    background: rgba(19, 127, 236, 0.08);
    color: var(--color-primary);
}

.control-item.active {
    background: var(--color-primary);
    color: white;
}

/* Toggle Switch */
.toggle-switch {
    width: 2.5rem;
    height: 1.25rem;
    background: #cbd5e1;
    border-radius: 9999px;
    position: relative;
    transition: all 0.3s ease;
}

.dark .toggle-switch {
    background: #334155;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1rem;
    height: 1rem;
    background: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input:checked+.toggle-switch {
    background: var(--color-primary);
}

input:checked+.toggle-switch::after {
    left: calc(100% - 1.25rem);
}