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

@layer base {
    /* Custom Base Styles */
    body {
        @apply transition-colors duration-200;
    }

    /* Smooth transitions for dark mode */
    * {
        @apply transition-colors duration-150;
    }
}

@layer components {
    /* Custom Button Styles */
    .btn-primary {
        @apply bg-gradient-to-r from-teal-500 to-teal-600 hover:from-teal-600 hover:to-teal-700 text-white font-semibold py-2 px-4 rounded-lg shadow-md hover:shadow-lg transition-all duration-200;
    }

    .btn-secondary {
        @apply bg-gray-200 dark:bg-slate-700 hover:bg-gray-300 dark:hover:bg-slate-600 text-gray-700 dark:text-gray-300 font-semibold py-2 px-4 rounded-lg shadow-sm hover:shadow-md transition-all duration-200;
    }

    /* Custom Card Styles */
    .card {
        @apply bg-white dark:bg-slate-800 rounded-lg shadow-md p-6 border border-gray-100 dark:border-slate-700;
    }

    .card-header {
        @apply text-lg font-semibold text-gray-800 dark:text-white mb-4 pb-3 border-b border-gray-200 dark:border-slate-700;
    }

    /* Custom Input Styles */
    .input-custom {
        @apply w-full px-4 py-2 border border-gray-300 dark:border-slate-600 rounded-lg focus:ring-2 focus:ring-teal-500 dark:focus:ring-teal-400 focus:border-transparent bg-white dark:bg-slate-700 text-gray-900 dark:text-gray-100 placeholder-gray-400 dark:placeholder-gray-500;
    }

    /* Custom Badge Styles */
    .badge {
        @apply inline-flex items-center px-3 py-1 rounded-full text-xs font-semibold;
    }

    .badge-success {
        @apply bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200;
    }

    .badge-warning {
        @apply bg-yellow-100 dark:bg-yellow-900 text-yellow-800 dark:text-yellow-200;
    }

    .badge-danger {
        @apply bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200;
    }

    .badge-info {
        @apply bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200;
    }

    .badge-primary {
        @apply bg-teal-100 dark:bg-teal-900 text-teal-800 dark:text-teal-200;
    }

    /* Custom Table Styles */
    .table-responsive {
        @apply overflow-x-auto rounded-lg shadow;
    }

    .table {
        @apply w-full text-sm text-left text-gray-700 dark:text-gray-300;
    }

    .table thead {
        @apply bg-gradient-to-r from-teal-500 to-teal-600 dark:from-teal-700 dark:to-teal-800 text-white uppercase text-xs;
    }

    .table th {
        @apply px-6 py-3 font-semibold;
    }

    .table tbody tr {
        @apply bg-white dark:bg-slate-800 border-b border-gray-200 dark:border-slate-700 hover:bg-gray-50 dark:hover:bg-slate-700 transition-colors;
    }

    .table td {
        @apply px-6 py-4;
    }

    /* Custom Alert Styles */
    .alert {
        @apply p-4 rounded-lg mb-4;
    }

    .alert-success {
        @apply bg-green-50 dark:bg-green-900/30 border-l-4 border-green-500 text-green-800 dark:text-green-200;
    }

    .alert-warning {
        @apply bg-yellow-50 dark:bg-yellow-900/30 border-l-4 border-yellow-500 text-yellow-800 dark:text-yellow-200;
    }

    .alert-danger {
        @apply bg-red-50 dark:bg-red-900/30 border-l-4 border-red-500 text-red-800 dark:text-red-200;
    }

    .alert-info {
        @apply bg-blue-50 dark:bg-blue-900/30 border-l-4 border-blue-500 text-blue-800 dark:text-blue-200;
    }

    /* Loading Spinner */
    .spinner {
        @apply inline-block w-6 h-6 border-4 border-teal-200 dark:border-teal-700 border-t-teal-600 dark:border-t-teal-400 rounded-full animate-spin;
    }

    /* Stat Card */
    .stat-card {
        @apply bg-gradient-to-br from-white to-gray-50 dark:from-slate-800 dark:to-slate-900 rounded-xl shadow-lg p-6 border border-gray-100 dark:border-slate-700 hover:shadow-xl transition-all duration-300;
    }

    /* Mobile responsive padding */
    .container-responsive {
        @apply px-4 sm:px-6 lg:px-8;
    }

    /* Navigation Components */
    .kkd-nav-item {
        @apply inline-flex items-center gap-2 px-3 py-2 rounded-md text-sm font-medium text-slate-700 dark:text-slate-100 
               hover:text-teal-600 dark:hover:text-teal-300 hover:bg-teal-50 dark:hover:bg-slate-700 
               transition-all duration-150 cursor-pointer;
    }

    .kkd-nav-item:has(.active) {
        @apply text-teal-600 dark:text-teal-300 bg-teal-50 dark:bg-slate-700;
    }

    .kkd-dropdown-item {
        @apply block px-4 py-3 text-sm text-slate-700 dark:text-slate-100 hover:bg-teal-50 dark:hover:bg-slate-700 
               border-b border-gray-100 dark:border-slate-700 transition-colors duration-150 
               flex items-center gap-2.5;
    }

    .kkd-dropdown-item i {
        @apply text-slate-400 dark:text-slate-500 w-4 text-center flex-shrink-0;
    }

    .kkd-dropdown-active {
        @apply text-teal-600 dark:text-teal-300 bg-teal-50 dark:bg-slate-700 font-semibold;
    }

    .kkd-dropdown-active i {
        @apply text-teal-600 dark:text-teal-300;
    }

    /* Sidebar Styles */
    .kkd-sidebar-section {
        @apply text-xs font-bold text-slate-500 dark:text-slate-400 uppercase tracking-wider px-3 py-2 mt-4 mb-2;
    }

    .kkd-sidebar-section:first-of-type {
        @apply mt-2;
    }

    .kkd-sidebar-item {
        @apply flex items-center gap-3 px-3 py-2 rounded-lg text-sm text-slate-700 dark:text-slate-100 
               hover:bg-teal-50 dark:hover:bg-slate-700 transition-colors duration-150 cursor-pointer;
    }

    .kkd-sidebar-item i {
        @apply text-slate-400 dark:text-slate-500 w-4 text-center flex-shrink-0;
    }

    .kkd-sidebar-active {
        @apply text-teal-600 dark:text-teal-300 bg-teal-50 dark:bg-slate-700 font-semibold;
    }

    .kkd-sidebar-active i {
        @apply text-teal-600 dark:text-teal-400;
    }

    .kkd-sidebar-sub {
        @apply flex items-center gap-2 px-3 py-2 rounded-lg text-sm text-slate-600 dark:text-slate-300 
               hover:bg-teal-50 dark:hover:bg-slate-700 transition-colors duration-150 cursor-pointer;
    }

    .kkd-sidebar-sub i {
        @apply text-slate-400 dark:text-slate-500 flex-shrink-0;
    }

    .kkd-sidebar-sub-active {
        @apply text-teal-600 dark:text-teal-300 bg-teal-50 dark:bg-slate-700 font-semibold;
    }

    .kkd-sidebar-sub-active i {
        @apply text-teal-600 dark:text-teal-400;
    }
}

@layer utilities {
    /* Custom Gradient Backgrounds */
    .bg-gradient-teal {
        @apply bg-gradient-to-r from-teal-500 to-teal-600;
    }

    .bg-gradient-teal-dark {
        @apply bg-gradient-to-r from-teal-700 to-teal-800;
    }

    /* Text Gradient */
    .text-gradient-teal {
        @apply bg-clip-text text-transparent bg-gradient-to-r from-teal-500 to-teal-700;
    }

    /* Custom Shadows */
    .shadow-teal {
        box-shadow: 0 4px 14px 0 rgba(20, 184, 166, 0.39);
    }

    .shadow-teal-lg {
        box-shadow: 0 10px 30px 0 rgba(20, 184, 166, 0.3);
    }

    /* Scrollbar Utilities */
    .scrollbar-thin::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .scrollbar-thin::-webkit-scrollbar-track {
        @apply bg-gray-100 dark:bg-slate-800;
    }

    .scrollbar-thin::-webkit-scrollbar-thumb {
        @apply bg-teal-500 dark:bg-teal-600 rounded-full;
    }

    .scrollbar-thin::-webkit-scrollbar-thumb:hover {
        @apply bg-teal-600 dark:bg-teal-500;
    }
}

/* Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        @apply bg-white text-black;
    }
}

/* Mobile Specific Styles */
@media (max-width: 640px) {
    .mobile-padding {
        @apply px-3 py-2;
    }

    .mobile-text {
        @apply text-sm;
    }

    .card {
        @apply p-4;
    }
}

/* Tablet Specific Styles */
@media (min-width: 641px) and (max-width: 1024px) {
    .tablet-padding {
        @apply px-5 py-3;
    }
}
/* resources/css/app.css */
/* Button Animations */
.btn-hover-effect {
    transition: all 0.3s ease;
}

.btn-hover-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.dark .btn-hover-effect:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Pulse animation for loading */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

/* Slide in animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Bounce animation for notifications */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.bounce-animation {
    animation: bounce 2s infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-block {
        display: block !important;
    }
    
    .mobile-flex-col {
        flex-direction: column !important;
    }
}