/* 
    Magica Beauty
    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');

: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;
}