@layer base {
    body {
        @apply font-sans antialiased text-[#131316] bg-[#F7F7F8];
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        @apply tracking-[-0.02em] font-semibold text-[#131316];
    }
}

@layer components {
    .clerk-card {
        @apply bg-white border border-[#E5E7EB] rounded-xl shadow-clerk transition-all;
    }

    .clerk-btn-primary {
        @apply bg-brand hover:bg-brand-dark text-white font-medium py-2 px-4 rounded-clerk transition-all shadow-sm flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed;
    }

    .clerk-btn-secondary {
        @apply bg-white border border-[#E5E7EB] text-[#131316] hover:bg-gray-50 font-medium py-2 px-4 rounded-clerk transition-all shadow-sm flex items-center justify-center gap-2;
    }

    .clerk-input {
        @apply bg-white rounded-clerk px-3.5 py-2.5 text-sm text-[#131316] placeholder:text-gray-400 outline-none transition-all shadow-sm;
        border: 1px solid #D1D5DB !important;
    }

    .clerk-input:focus {
        border-color: var(--color-brand, #6366f1) !important;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

    .clerk-input:disabled {
        @apply bg-gray-50 text-gray-400 cursor-not-allowed;
        border-style: dashed !important;
    }

    .clerk-input::placeholder {
        @apply text-gray-400;
    }

    .clerk-label {
        @apply text-[11px] font-bold text-gray-500 uppercase tracking-widest mb-1.5 block;
    }

    .clerk-checkbox {
        @apply w-4 h-4 rounded border-[#D1D5DB] text-brand focus:ring-brand bg-white transition-all cursor-pointer;
    }
}

/* Animations & Global Utilities (Merged from admin-styles.css) */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f9fafb;
}

::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}

/* Global Transition Utilities */
.sidebar-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Table container styling for horizontal scroll */
.clerk-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Chart container minimum heights */
.clerk-chart-wrapper {
    min-height: 320px;
}

/* Dashboard specific refinements */
.admin-card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 1, 0.05);
}

/* Fix for nested inputs in Clerk theme */
.clerk-input::placeholder {
    color: #9CA3AF;
}

/* Responsive Hide Utilities */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}