@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    --sarkin-mota-brown: #5d4037;
    --sarkin-mota-dark: #3e2723;
    --sarkin-mota-light: #8d6e63;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(62, 39, 35, 0.08);
}

@layer base {
    body {
        @apply bg-slate-50 text-gray-900 antialiased;
        font-family: "Inter", "SF Pro Display", system-ui, sans-serif;
    }
    * {
        box-sizing: border-box;
    }
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
    ::-webkit-scrollbar-track {
        background: #f1f5f9;
    }
    ::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 3px;
    }
    ::-webkit-scrollbar-thumb:hover {
        background: #8d6e63;
    }
}

@layer components {
    .btn-primary {
        @apply bg-primary-500 text-white px-5 py-2.5 rounded-xl hover:bg-primary-600 active:bg-primary-700 transition-all duration-200 font-semibold shadow-sm hover:shadow-md;
    }
    .btn-secondary {
        @apply bg-gray-100 text-gray-800 px-5 py-2.5 rounded-xl hover:bg-gray-200 transition-all duration-200 font-semibold;
    }
    .btn-danger {
        @apply bg-red-600 text-white px-5 py-2.5 rounded-xl hover:bg-red-700 transition-all duration-200 font-semibold shadow-sm;
    }
    .input-field {
        @apply w-full px-4 py-3 border-2 border-gray-200 rounded-xl focus:ring-2 focus:ring-primary-500 focus:border-primary-500 outline-none transition-all duration-200 bg-white text-gray-900;
    }
    .card {
        @apply bg-white rounded-2xl shadow-sm p-6 border border-gray-100/80;
    }
    .stat-card {
        @apply bg-white rounded-2xl shadow-sm p-6 border border-gray-100/80 hover:shadow-lg transition-all duration-200;
    }

    /* Glassmorphism */
    .glass {
        background: var(--glass-bg);
        backdrop-filter: blur(16px) saturate(180%);
        -webkit-backdrop-filter: blur(16px) saturate(180%);
        border: 1px solid var(--glass-border);
        box-shadow: var(--glass-shadow);
    }
    .glass-dark {
        background: rgba(15, 15, 40, 0.65);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
    .glass-brown {
        background: rgba(93, 64, 55, 0.07);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(93, 64, 55, 0.15);
    }

    /* Sarkin Mota brand gradient */
    .sarkin-mota-gradient {
        background: linear-gradient(
            135deg,
            #6d4c41 0%,
            #3e2723 50%,
            #4e342e 100%
        );
    }
    .sarkin-mota-gradient-soft {
        background: linear-gradient(
            135deg,
            rgba(93, 64, 55, 0.08) 0%,
            rgba(93, 64, 55, 0.03) 100%
        );
    }

    /* KPI card with gradient accent */
    .kpi-card {
        @apply bg-white rounded-2xl p-6 border border-gray-100 hover:shadow-xl transition-all duration-300 relative overflow-hidden;
    }
    .kpi-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #6d4c41, #8d6e63);
    }

    /* Table */
    .data-table th {
        @apply px-4 py-3 text-left text-xs font-bold text-gray-500 uppercase tracking-wider bg-gray-50/80;
    }
    .data-table td {
        @apply px-4 py-3 text-sm text-gray-700 border-b border-gray-50;
    }
    .data-table tr:hover td {
        @apply bg-primary-50/30;
    }
}

.loader {
    border: 3px solid #d7ccc8;
    border-top: 3px solid #6d4c41;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.pulse-dot {
    animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}
