/* 
    Fallox Suite
    Common CSS variables and base styles
    Fallox Developments 2025
*/

/* Import Default Fonts (Fallback) */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&family=Playfair+Display:wght@400;600&display=swap');
@import url('https://fonts.googleapis.com/css?family=Iceland:400');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    /* --- FONTS (Dynamic) --- */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;

    /* --- COLORS --- */
    --primary: #B98B82;         /* Btn, border, Preloader-ring-1 ect...*/
    --primary-hover: #A67A71;   /* Hovered Btn, Preloader-ring-2, ect...*/
    --primary-text:  white;     /* Main text color */
    --secondary: #a58c87;       /* Preloader-ring-3 */
    --background: #232323;      /* Main back color */
    --border: var(--primary);
    --nav-bg: #111827;
    --text-primary: #5c4b45;
    --text-secondary: #221b17;
    --card: #745953;
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.05);
    
    /* Status Colors */
    --status-pending-bg: #fff3cd;
    --status-pending-text: #856404;
    --status-approved-bg: #d4edda;
    --status-approved-text: #155724;
    --status-rejected-bg: #f8d7da;
    --status-rejected-text: #721c24;

    /* Admin Only */
    --admin-bg: var(--background);
    --admin-sidebar-bg: #0f0e0e;
    --admin-sidebar-text: var(--primary-text);
    --admin-header-bg: #ffffff;
    --admin-text-color: #333333;       
    --admin-text-color-light: #ecf0f1; 
    --admin-border-color: #e0e0e0;
    --admin-card-bg: #ffffff;
    --admin-input-bg: #ffffff;
    --admin-input-border: #cccccc;
    --admin-sidebar-width: 250px;
}

html.dark {
    --background: #1c1a19;
    --text-primary: #f1e1cb;
    --text-secondary: #b8aaa0;
    --card-bg: #2b2826;
    --card-shadow: rgba(0, 0, 0, 0.2);
    --border: #4a4440;
}

/* Apply Fonts */
body {
    font-family: var(--font-body);
    background-color: var(--background);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
}

/* --- TOAST CONTAINER --- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
}

/* --- INDIVIDUAL TOAST --- */
.toast {
    position: relative;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: auto;
    max-width: 300px;
    pointer-events: all;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease, margin-top 0.3s ease, height 0.3s ease, padding 0.3s ease;
}
.toast.show {
    opacity: 1;
    transform: translateX(0);
}
.toast.hiding {
    opacity: 0;
    transform: translateX(100%);
    padding: 0 1.5rem;
    height: 0;
    margin-bottom: -10px;
}
.toast.success { background-color: #28a745; }
.toast.error { background-color: #dc3545; }
.toast.info { background-color: #007bff; }

/* Buttons */
.btn, button,
.btn-primary, .btn-danger, .btn-success, 
.btn-warning, .btn-sm, .btn-secondary, .btn-export,
.btn-info, .btn-dark, .btn-light, .btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-body); /* Buttons use body font */
    font-weight: 500;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
    transition: background-color 0.2s, transform 0.1s, color 0.2s;
}
.btn-primary { background-color: #D1A6A0; }
.btn-danger { background-color: #ef4444; color: white !important; }
.btn-danger:hover { background-color: #dc2626; }
.btn-success { background-color: #10b981; color: white !important; }
.btn-success:hover { background-color: #059669; }
.btn-warning { background-color: #f59e0b; color: white !important; }
.btn-warning:hover { background-color: #d97706; }
.btn-sm { padding: 5px 10px; font-size: 12px; font-weight: 300; }
.btn-secondary { background-color: #6b7280; color: white !important; }
.btn-secondary:hover { background-color: #4b5563; }
.btn-export, .btn-light { background-color: #ffffff; color: #374151 !important; border-color: #d1d5db; }
.btn-export:hover, .btn-light:hover { background-color: #f3f4f6; color: #111827 !important; border-color: #9ca3af; }
.btn-info { background-color: #0ea5e9; color: white !important; }
.btn-info:hover { background-color: #0284c7; }
.btn-dark { background-color: #1f2937; color: white !important; }
.btn-dark:hover { background-color: #111827; }
.btn-link { background-color: transparent; color: var(--primary-text) !important; border: none; text-decoration: underline; padding: 5px 10px; }
.btn-link:hover { color: var(--primary-text) !important; background-color: rgba(0,0,0,0.05); text-decoration: none; }
.btn-outline-primary { background-color: transparent; border: 1px solid var(--primary); color: var(--primary-text) !important; }
.btn-outline-primary:hover { background-color: var(--primary); color: white !important; }
.btn-outline-danger { background-color: transparent; border: 1px solid #ef4444; color: #ef4444 !important; }
.btn-outline-danger:hover { background-color: #ef4444; color: white !important; }
.btn-outline-success { background-color: transparent; border: 1px solid #10b981; color: #10b981 !important; }
.btn-outline-success:hover { background-color: #10b981; color: white !important; }

/* Vouchers */
@media print {
    /* Hide everything by default */
    body > * {
        display: none !important;
    }

    /* Only show the print modal */
    #voucher-print-modal {
        display: flex !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: white !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 9999 !important;
    }

    /* Ensure modal content is visible */
    #voucher-print-modal > div {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
    }

    /* Force background graphics (for the pink header) */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* Accessibility: High Contrast Focus Ring */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Ensure focus isn't hidden on buttons */
button:focus {
    outline: none; /* Let the ring handle it or custom style below */
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.5);
}

/* Screen Reader Only Class (standard utility) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.ants-card { 
    position: relative; 
    z-index: 1; 
    border-radius: 3rem; 
    background: #f4f4f5;
}
.ants-card::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit;
    padding: 4px; 
    background: #F8AD9D; 
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none; transition: background 0.3s;
    z-index: 50; /* This forces the border to sit on top of the solid backgrounds! */
}
.ants-card:hover::after {
    background: repeating-linear-gradient(45deg, #F8AD9D, #F8AD9D 15px, transparent 15px, transparent 30px);
    background-size: 42.42px 42.42px;
    animation: march-card 1s linear infinite;
}
@keyframes march-card { to { background-position: 42.42px 0; } }

/* ANTS CARD ANIMATED BORDER */
.call-ants-active {
    position: relative;
}

.call-ants-active::before {
    content: '';
    position: absolute;
    inset: -5px; /* Thickness of the ants border */
    z-index: -1;
    border-radius: inherit;
    background: repeating-linear-gradient(
        -45deg,
        #f8ad9d,
        #f8ad9d 8px,
        transparent 8px,
        transparent 16px
    );
    background-size: 23px 23px;
    animation: move-ants 0.8s linear infinite;
    box-shadow: 0 0 15px rgba(248, 173, 157, 0.5);
}

@keyframes move-ants {
    0% { background-position: 0 0; }
    100% { background-position: 23px 0; }
}

.floating-shadow {
    /* Pushes the shadow heavily down and to the right */
    box-shadow: 15px 25px 40px -5px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}
.floating-shadow:hover {
    /* Shifts to a soft peach glow and floats upward on hover */
    box-shadow: 20px 35px 50px -5px rgba(248, 173, 157, 0.3); 
    transform: translateY(-8px);
}

.pop-bounce {
    opacity: 0;
    /* Uses a custom cubic-bezier to create a physical "spring" effect */
    animation: pop-bounce-anim 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes pop-bounce-anim {
    0% { opacity: 0; transform: scale(0.8) translateY(40px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.glass-reflect { overflow: hidden; }
.glass-reflect::before {
    content: ''; position: absolute; top: 0; left: -100%;
    width: 50%; height: 100%;
    /* Boosted the white opacity so it pops hard against the zinc background */
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    z-index: 99; /* Forces the glass to sweep OVER the text and buttons! */
    pointer-events: none;
}
.glass-reflect:hover::before {
    animation: shine-effect 0.75s ease-in-out;
}
@keyframes shine-effect { 100% { left: 200%; } }

.subtle-btn {
    background-color: #F8AD9D;
    color: white;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}
.subtle-btn:hover {
    background-color: white;
    color: #18181b; /* Snaps to dark zinc text */
    border-color: #F8AD9D;
    box-shadow: 0 10px 25px -5px rgba(248, 173, 157, 0.5);
    transform: scale(1.03);
}

.attention-pulse {
    /* Must be inline-block for transforms to work on a span */
    display: inline-block;
    animation: pulse-glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.text-pulse {
    display: inline-block;
    animation: text-pulse-glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-glow {
    0% { 
        transform: scale(1); 
        /* Starting glow is slightly more opaque */
        box-shadow: 0 0 0 0 rgba(248, 173, 157, 0.8); 
    }
    50% { 
        /* Slightly larger bounce */
        transform: scale(1.08); 
        /* Shockwave expands further (15px instead of 8px) before fading */
        box-shadow: 0 0 0 15px rgba(248, 173, 157, 0); 
    }
    100% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 rgba(248, 173, 157, 0); 
    }
}

@keyframes text-pulse-glow {
    0% { transform: scale(1); text-shadow: 0 0 0 rgba(248, 173, 157, 0.8); }
    50% { transform: scale(1.08); text-shadow: 0 0 15px rgba(248, 173, 157, 0); }
    100% { transform: scale(1); text-shadow: 0 0 0 rgba(248, 173, 157, 0); }
}

@keyframes floatLumina { 
    0%, 100% { transform: translate(0, 0) scale(1); } 
    33% { transform: translate(20px, -15px) scale(1.05); } 
    66% { transform: translate(-15px, 15px) scale(0.95); } 
}

/* Preloaders */
.draw-path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: draw-sig 2.5s ease-in-out forwards infinite alternate;
}
@keyframes draw-sig {
    0% { stroke-dashoffset: 400; }
    100% { stroke-dashoffset: 0; }
}

.cart-loader { animation: driveCart 1.5s infinite ease-in-out alternate; }
@keyframes driveCart { 
    from { transform: translateX(-25px) rotate(-8deg) scale(0.9); } 
    to { transform: translateX(25px) rotate(8deg) scale(1.1); } 
}