/* Custom CSS - Additional styles */

/* Prevent Material Symbols flicker (FOUT) */
.material-symbols-outlined {
    display: inline-block;
    overflow: hidden;
    text-indent: -9999px;
    /* Hide text until font loads */
    width: 1em;
    height: 1em;
    vertical-align: middle;
    line-height: 1;
}

/* Once font is loaded, Google Fonts applies the font-family which renders the icon correctly */
/* We need to ensure the text-indent is reset when the font is applied */
[class^="material-symbols-"],
[class*=" material-symbols-"] {
    text-indent: 0 !important;
}

/* =====================
   CSS VARIABLES
   ===================== */
:root {
    --primary: #1565c1;
    --primary-dark: #0d47a1;
    --bg-light: #f6f7f8;
    --bg-dark: #111418;
    --surface-light: #ffffff;
    --surface-dark: #1e242b;
    --border-light: #e5e7eb;
    --border-dark: #293038;
    --text-light: #111827;
    --text-dark: #ffffff;
    --text-muted-light: #6b7280;
    --text-muted-dark: #9daab8;
}

/* =====================
   BASE STYLES
   ===================== */
html {
    scroll-behavior: smooth;
}

::selection {
    background-color: var(--primary);
    color: white;
}

/* =====================
   DARK MODE FORCED
   ===================== */
/* This site is dark theme only - force dark colors */
body {
    background-color: #111418 !important;
    color: #ffffff !important;
}

.theme-bg {
    background-color: var(--surface-dark);
}

.theme-border {
    border-color: var(--border-dark);
}

.theme-text {
    color: var(--text-dark);
}

.theme-text-muted {
    color: var(--text-muted-dark);
}

/* =====================
   FOCUS STATES
   ===================== */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(21, 101, 193, 0.2);
}

/* =====================
   BUTTON STYLES
   ===================== */
.btn-primary {
    background: var(--primary);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(21, 101, 193, 0.3);
}

/* =====================
   CARD EFFECTS
   ===================== */
.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(21, 101, 193, 0.15);
}

.image-zoom {
    overflow: hidden;
}

.image-zoom img,
.image-zoom>div {
    transition: transform 0.5s ease;
}

.image-zoom:hover img,
.image-zoom:hover>div {
    transform: scale(1.05);
}

/* =====================
   LOADING SPINNER
   ===================== */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Full page loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 20, 24, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #1e242b 25%, #293038 50%, #1e242b 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* =====================
   TOAST NOTIFICATIONS
   ===================== */
#toast-container {
    position: fixed;
    top: 80px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
}

.toast-enter {
    animation: toast-in 0.3s ease forwards;
}

.toast-exit {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* =====================
   MOBILE MENU
   ===================== */
#mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--surface-dark);
    border-left: 1px solid var(--border-dark);
    z-index: 100;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

#mobile-menu.translate-x-full {
    transform: translateX(100%);
}

#mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 99;
}

/* =====================
   TIMELINE
   ===================== */
.timeline-line::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 7px;
    width: 2px;
    background: var(--border-dark);
    z-index: 0;
}

/* =====================
   GLASS PANEL
   ===================== */
.glass-panel {
    background: rgba(30, 36, 43, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* =====================
   LINE CLAMP
   ===================== */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =====================
   SCROLLBAR
   ===================== */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a4350;
}

/* =====================
   FORM INPUT
   ===================== */
.form-input {
    background: var(--surface-dark);
    border: 1px solid var(--border-dark);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.form-input:focus {
    border-color: var(--primary);
    background: #232a33;
}

.form-input::placeholder {
    color: var(--text-muted-dark);
}

/* =====================
   TABLE STYLES
   ===================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-dark);
}

.data-table th {
    background: var(--surface-dark);
    font-weight: 600;
    color: var(--text-muted-dark);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tr:hover {
    background: rgba(41, 48, 56, 0.5);
}

/* =====================
   STATUS BADGES
   ===================== */
.status-pending {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.status-paid {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.status-processing {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.status-completed {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.status-cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* =====================
   BADGE PULSE
   ===================== */
.badge-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* =====================
   FADE ANIMATIONS
   ===================== */
.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================
   PRINT STYLES
   ===================== */
@media print {

    header,
    footer,
    .no-print,
    #toast-container,
    #mobile-menu,
    #mobile-menu-overlay {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
    #toast-container {
        left: 16px;
        right: 16px;
        max-width: none;
    }
}