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

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

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translate3d(0,0,0); }
    40%, 43% { transform: translate3d(0,-30px,0); }
    70% { transform: translate3d(0,-15px,0); }
    90% { transform: translate3d(0,-4px,0); }
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

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

.animate-pulse-custom {
    animation: pulse 2s infinite;
}

.animate-bounce-custom {
    animation: bounce 1s infinite;
}

/* Enhanced Alert Styles */
.alert-success {
    @apply bg-green-50 border-l-4 border-green-400 rounded-md p-4 shadow-sm animate-fade-in;
}

.alert-error {
    @apply bg-red-50 border-l-4 border-red-400 rounded-md p-4 shadow-sm animate-fade-in;
}

.alert-warning {
    @apply bg-yellow-50 border-l-4 border-yellow-400 rounded-md p-4 shadow-sm animate-fade-in;
}

.alert-info {
    @apply bg-blue-50 border-l-4 border-blue-400 rounded-md p-4 shadow-sm animate-fade-in;
}

/* Enhanced Button Styles */
.btn-primary {
    @apply inline-flex items-center px-6 py-3 bg-gradient-to-r from-blue-600 to-blue-700 border border-transparent rounded-lg font-semibold text-sm text-white tracking-wide hover:from-blue-700 hover:to-blue-800 active:from-blue-800 active:to-blue-900 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed transform transition-all duration-200 hover:scale-105 shadow-lg hover:shadow-xl;
}

.btn-secondary {
    @apply inline-flex items-center px-6 py-3 bg-white border-2 border-gray-300 rounded-lg font-semibold text-sm text-gray-700 tracking-wide shadow-sm hover:bg-gray-50 hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 active:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed transform transition-all duration-200 hover:scale-105;
}

.btn-danger {
    @apply inline-flex items-center px-6 py-3 bg-gradient-to-r from-red-600 to-red-700 border border-transparent rounded-lg font-semibold text-sm text-white tracking-wide hover:from-red-700 hover:to-red-800 active:from-red-800 active:to-red-900 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed transform transition-all duration-200 hover:scale-105 shadow-lg hover:shadow-xl;
}

.btn-success {
    @apply inline-flex items-center px-6 py-3 bg-gradient-to-r from-green-600 to-green-700 border border-transparent rounded-lg font-semibold text-sm text-white tracking-wide hover:from-green-700 hover:to-green-800 active:from-green-800 active:to-green-900 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed transform transition-all duration-200 hover:scale-105 shadow-lg hover:shadow-xl;
}

.btn-outline {
    @apply inline-flex items-center px-6 py-3 bg-transparent border-2 border-current rounded-lg font-semibold text-sm tracking-wide hover:bg-current hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed transform transition-all duration-200 hover:scale-105;
}

/* Enhanced Form Styles */
.form-input {
    @apply border-2 border-gray-300 focus:border-blue-500 focus:ring-2 focus:ring-blue-200 focus:ring-opacity-50 rounded-lg shadow-sm transition-all duration-200 hover:border-gray-400 placeholder-gray-400;
}

.form-select {
    @apply border-2 border-gray-300 focus:border-blue-500 focus:ring-2 focus:ring-blue-200 focus:ring-opacity-50 rounded-lg shadow-sm transition-all duration-200 hover:border-gray-400 cursor-pointer;
}

.form-textarea {
    @apply border-2 border-gray-300 focus:border-blue-500 focus:ring-2 focus:ring-blue-200 focus:ring-opacity-50 rounded-lg shadow-sm transition-all duration-200 hover:border-gray-400 placeholder-gray-400 resize-none;
}

.form-label {
    @apply block text-sm font-semibold text-gray-700 mb-2;
}

.form-group {
    @apply mb-6;
}

.form-error {
    @apply text-red-600 text-sm mt-1 animate-fade-in;
}

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

.table-auto {
    @apply min-w-full divide-y divide-gray-200 bg-white;
}

.table-auto thead {
    @apply bg-gradient-to-r from-gray-50 to-gray-100;
}

.table-auto th {
    @apply px-6 py-4 text-left text-xs font-bold text-gray-600 uppercase tracking-wider border-b-2 border-gray-200;
}

.table-auto td {
    @apply px-6 py-4 whitespace-nowrap text-sm text-gray-900 border-b border-gray-100;
}

.table-auto tbody tr {
    @apply hover:bg-gray-50 transition-colors duration-150;
}

/* Enhanced Card Styles */
.card {
    @apply bg-white overflow-hidden shadow-lg rounded-xl border border-gray-100 transition-all duration-300 hover:shadow-xl;
}

.card-header {
    @apply px-6 py-4 border-b border-gray-200 bg-gradient-to-r from-gray-50 to-gray-100;
}

.card-body {
    @apply p-6;
}

.card-footer {
    @apply px-6 py-4 border-t border-gray-200 bg-gray-50;
}

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

.badge-success {
    @apply bg-green-100 text-green-800 border border-green-200;
}

.badge-warning {
    @apply bg-yellow-100 text-yellow-800 border border-yellow-200;
}

.badge-danger {
    @apply bg-red-100 text-red-800 border border-red-200;
}

.badge-info {
    @apply bg-blue-100 text-blue-800 border border-blue-200;
}

.badge-secondary {
    @apply bg-gray-100 text-gray-800 border border-gray-200;
}

/* Loading Spinner Enhanced */
.spinner {
    @apply animate-spin rounded-full h-5 w-5 border-2 border-white border-t-transparent;
}

.spinner-lg {
    @apply animate-spin rounded-full h-8 w-8 border-2 border-blue-600 border-t-transparent;
}

/* Progress Bar */
.progress-bar {
    @apply w-full bg-gray-200 rounded-full h-2 overflow-hidden;
}

.progress-fill {
    @apply h-full bg-gradient-to-r from-blue-500 to-blue-600 rounded-full transition-all duration-500 ease-out;
}

/* Tooltip */
.tooltip {
    @apply absolute z-50 px-3 py-2 text-sm text-white bg-gray-900 rounded-lg shadow-lg opacity-0 pointer-events-none transition-opacity duration-200;
}

.tooltip.show {
    @apply opacity-100 pointer-events-auto;
}

/* Modal Overlay */
.modal-overlay {
    @apply fixed inset-0 bg-black bg-opacity-50 z-40 transition-opacity duration-300;
}

.modal-content {
    @apply bg-white rounded-xl shadow-2xl transform transition-all duration-300 max-w-lg w-full mx-4;
}

/* Dropdown Menu */
.dropdown-menu {
    @apply absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-lg border border-gray-200 z-50 opacity-0 invisible transform scale-95 transition-all duration-200;
}

.dropdown-menu.show {
    @apply opacity-100 visible scale-100;
}

.dropdown-item {
    @apply block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 transition-colors duration-150;
}

/* Status Indicators */
.status-dot {
    @apply inline-block w-2 h-2 rounded-full mr-2;
}

.status-dot.success {
    @apply bg-green-500 animate-pulse-custom;
}

.status-dot.warning {
    @apply bg-yellow-500 animate-pulse-custom;
}

.status-dot.danger {
    @apply bg-red-500 animate-pulse-custom;
}

.status-dot.info {
    @apply bg-blue-500 animate-pulse-custom;
}

/* Navigation Enhancements */
.nav-link {
    @apply flex items-center px-4 py-3 text-sm font-medium text-gray-700 rounded-lg hover:bg-gray-100 hover:text-gray-900 transition-all duration-200;
}

.nav-link.active {
    @apply bg-blue-100 text-blue-700 border-r-4 border-blue-500;
}

.nav-icon {
    @apply w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500 transition-colors duration-200;
}

.nav-link.active .nav-icon {
    @apply text-blue-500;
}

/* File Upload */
.file-upload {
    @apply relative border-2 border-dashed border-gray-300 rounded-lg p-6 hover:border-gray-400 transition-colors duration-200;
}

.file-upload.dragover {
    @apply border-blue-500 bg-blue-50;
}

/* Search Input */
.search-input {
    @apply pl-10 pr-4 py-2 border-2 border-gray-300 rounded-lg focus:border-blue-500 focus:ring-2 focus:ring-blue-200 focus:ring-opacity-50 transition-all duration-200;
}

/* Responsive utilities */
@media (max-width: 640px) {
    .mobile-hidden {
        @apply hidden;
    }
    
    .mobile-full {
        @apply w-full;
    }
    
    .mobile-stack {
        @apply flex-col space-y-2 space-x-0;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-danger,
    .btn-success {
        @apply w-full justify-center;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .dark-mode {
        @apply bg-gray-900 text-white;
    }
    
    .dark-mode .card {
        @apply bg-gray-800 border-gray-700;
    }
    
    .dark-mode .form-input,
    .dark-mode .form-select,
    .dark-mode .form-textarea {
        @apply bg-gray-700 border-gray-600 text-white;
    }
}

/* Print Styles */
@media print {
    .no-print {
        @apply hidden;
    }
    
    .print-full-width {
        @apply w-full;
    }
    
    body {
        @apply text-black bg-white;
    }
}

