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

/* Base Overrides */
html, body {
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0f1115; /* dark bg */
}
::-webkit-scrollbar-thumb {
    background: #272a30; /* slightly lighter */
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3f444d;
}

/* Glassmorphism utilities */
.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Micro-animations */
.hover-lift {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.5);
}

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

/* Smooth color shifting for the Sky Theme */
@property --bg-dark-900 { syntax: '<color>'; inherits: true; initial-value: #08090c; }
@property --bg-dark-800 { syntax: '<color>'; inherits: true; initial-value: #0e1015; }
@property --bg-dark-700 { syntax: '<color>'; inherits: true; initial-value: #151821; }
@property --bg-dark-600 { syntax: '<color>'; inherits: true; initial-value: #1d212d; }
@property --brand-primary { syntax: '<color>'; inherits: true; initial-value: #3b82f6; }
@property --brand-accent { syntax: '<color>'; inherits: true; initial-value: #6366f1; }
@property --brand-success { syntax: '<color>'; inherits: true; initial-value: #10b981; }
@property --brand-warning { syntax: '<color>'; inherits: true; initial-value: #f59e0b; }
@property --brand-danger { syntax: '<color>'; inherits: true; initial-value: #ef4444; }

html {
    transition: 
        --bg-dark-900 3s cubic-bezier(0.4, 0, 0.2, 1),
        --bg-dark-800 3s cubic-bezier(0.4, 0, 0.2, 1),
        --bg-dark-700 3s cubic-bezier(0.4, 0, 0.2, 1),
        --bg-dark-600 3s cubic-bezier(0.4, 0, 0.2, 1),
        --brand-primary 3s cubic-bezier(0.4, 0, 0.2, 1),
        --brand-accent 3s cubic-bezier(0.4, 0, 0.2, 1),
        --brand-success 3s cubic-bezier(0.4, 0, 0.2, 1),
        --brand-warning 3s cubic-bezier(0.4, 0, 0.2, 1),
        --brand-danger 3s cubic-bezier(0.4, 0, 0.2, 1);
}

body, main, header, nav, .glass-panel, button, input, select, textarea, table, tbody, tr, td, th {
    transition: background-color 3s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 3s cubic-bezier(0.4, 0, 0.2, 1), 
                color 3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 3s cubic-bezier(0.4, 0, 0.2, 1);
}

:root {
    /* Night Theme (Default fallback) */
    --bg-dark-900: #08090c;
    --bg-dark-800: #0e1015;
    --bg-dark-700: #151821;
    --bg-dark-600: #1d212d;
    --brand-primary: #3b82f6;
    --brand-accent: #6366f1;
    --brand-success: #10b981;
    --brand-warning: #f59e0b;
    --brand-danger: #ef4444;
}

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

/* Rainbow Glow Hover Effect */
.hover-rainbow-glow {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.hover-rainbow-glow:hover {
    transform: translateY(-4px);
    z-index: 20;
}

.hover-rainbow-glow::before,
.hover-rainbow-glow::after {
    content: '';
    position: absolute;
    inset: -2px;
    z-index: -1;
    background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    border-radius: inherit;
    background-size: 400%;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.hover-rainbow-glow::after {
    filter: blur(20px);
    z-index: -2;
}

.hover-rainbow-glow:hover::before,
.hover-rainbow-glow:hover::after {
    opacity: 0.8;
    animation: rainbow-glow-anim 20s linear infinite;
}

@keyframes rainbow-glow-anim {
    0% { background-position: 0 0; }
    50% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

/* Active Rainbow Glow Effect (Constant) */
.active-rainbow-glow {
    position: relative;
    transform-style: preserve-3d;
    z-index: 1; /* Ensure it creates a stacking context */
}

.active-rainbow-glow::before,
.active-rainbow-glow::after {
    content: '';
    position: absolute;
    inset: -2px;
    z-index: -1;
    background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    border-radius: inherit;
    background-size: 400%;
    opacity: 0.6; /* Slightly dimmer than hover for a persistent active state */
    animation: rainbow-glow-anim 20s linear infinite;
}

.active-rainbow-glow::after {
    filter: blur(15px);
    z-index: -2;
}

/* Inline Invoice Box */
.invoice-box {
    width: 8.5in;
    min-height: 11in;
    background: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    padding: 1in;
    position: relative;
    box-sizing: border-box;
    color: #1f2937; /* Gray-800 */
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
}

.invoice-box [contenteditable="true"] {
    outline: 2px dashed #FF3366;
    background: rgba(255, 51, 102, 0.05);
    border-radius: 4px;
    padding: 2px;
    transition: all 0.2s;
}

.invoice-box [contenteditable="true"]:focus {
    outline: 2px solid #FF3366;
    background: rgba(255, 51, 102, 0.1);
}

.invoice-gradient-text {
    background: linear-gradient(135deg, #FF3366 0%, #FF9933 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media print {
    .invoice-box {
        box-shadow: none;
        width: 100%;
        min-height: auto;
        padding: 0;
    }
    .no-print {
        display: none !important;
    }
    body * {
        visibility: hidden;
    }
    #inlineInvoiceContainer, #inlineInvoiceContainer * {
        visibility: visible;
    }
    #inlineInvoiceContainer {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
}
