/* Custom styles */
.form-input {
    @apply block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm;
}

.form-label {
    @apply block text-sm font-medium text-gray-700;
}

.form-error {
    @apply mt-2 text-sm text-red-600;
}

.form-success {
    @apply mt-2 text-sm text-green-600;
}

.btn {
    @apply inline-flex justify-center rounded-md border border-transparent px-4 py-2 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2;
}

.btn-primary {
    @apply bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500;
}

.btn-danger {
    @apply bg-red-600 text-white hover:bg-red-700 focus:ring-red-500;
}

.btn-success {
    @apply bg-green-600 text-white hover:bg-green-700 focus:ring-green-500;
}

.card {
    @apply bg-white shadow rounded-lg;
}

.card-header {
    @apply px-4 py-5 border-b border-gray-200 sm:px-6;
}

.card-body {
    @apply px-4 py-5 sm:p-6;
}

.card-footer {
    @apply px-4 py-4 sm:px-6 border-t border-gray-200;
}

.nav-link {
    @apply text-gray-500 hover:text-gray-900 px-3 py-2 rounded-md text-sm font-medium;
}

.nav-link-active {
    @apply bg-gray-100 text-gray-900 px-3 py-2 rounded-md text-sm font-medium;
}

.alert {
    @apply rounded-md p-4 mb-4;
}

.alert-error {
    @apply bg-red-50 border border-red-400 text-red-700;
}

.alert-success {
    @apply bg-green-50 border border-green-400 text-green-700;
}

.alert-info {
    @apply bg-blue-50 border border-blue-400 text-blue-700;
}

.alert-warning {
    @apply bg-yellow-50 border border-yellow-400 text-yellow-700;
}

.table {
    @apply min-w-full divide-y divide-gray-200;
}

.table-header {
    @apply bg-gray-50;
}

.table-header th {
    @apply px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider;
}

.table-body {
    @apply bg-white divide-y divide-gray-200;
}

.table-body td {
    @apply px-6 py-4 whitespace-nowrap text-sm text-gray-500;
}

.badge {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
}

.badge-success {
    @apply bg-green-100 text-green-800;
}

.badge-error {
    @apply bg-red-100 text-red-800;
}

.badge-warning {
    @apply bg-yellow-100 text-yellow-800;
}

.badge-info {
    @apply bg-blue-100 text-blue-800;
}

/* Responsive utilities */
@media (max-width: 640px) {
    .container {
        @apply px-4;
    }
    
    .table-responsive {
        @apply block w-full overflow-x-auto;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }
}

/* Dark mode styles */
.dark .form-input {
    @apply border-gray-600 bg-gray-700 text-white focus:border-blue-400 focus:ring-blue-400;
}

.dark .form-label {
    @apply text-gray-300;
}

.dark .form-error {
    @apply text-red-400;
}

.dark .form-success {
    @apply text-green-400;
}

.dark .btn-primary {
    @apply bg-blue-600 hover:bg-blue-700 focus:ring-blue-400;
}

.dark .btn-danger {
    @apply bg-red-600 hover:bg-red-700 focus:ring-red-400;
}

.dark .btn-success {
    @apply bg-green-600 hover:bg-green-700 focus:ring-green-400;
}

.dark .card {
    @apply bg-gray-800 shadow-lg;
}

.dark .card-header {
    @apply border-gray-700;
}

.dark .card-footer {
    @apply border-gray-700;
}

.dark .nav-link {
    @apply text-gray-400 hover:text-white;
}

.dark .nav-link-active {
    @apply bg-gray-700 text-white;
}

.dark .alert-error {
    @apply bg-red-900 border-red-700 text-red-300;
}

.dark .alert-success {
    @apply bg-green-900 border-green-700 text-green-300;
}

.dark .alert-info {
    @apply bg-blue-900 border-blue-700 text-blue-300;
}

.dark .alert-warning {
    @apply bg-yellow-900 border-yellow-700 text-yellow-300;
}

.dark .table-header {
    @apply bg-gray-700;
}

.dark .table-header th {
    @apply text-gray-300;
}

.dark .table-body {
    @apply bg-gray-800 divide-gray-700;
}

.dark .table-body td {
    @apply text-gray-300;
}

.dark .badge-success {
    @apply bg-green-800 text-green-200;
}

.dark .badge-error {
    @apply bg-red-800 text-red-200;
}

.dark .badge-warning {
    @apply bg-yellow-800 text-yellow-200;
}

.dark .badge-info {
    @apply bg-blue-800 text-blue-200;
}

/* Theme transition */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Custom scrollbar for dark mode */
.dark ::-webkit-scrollbar-track {
    background: #374151;
}

.dark ::-webkit-scrollbar-thumb {
    background: #6b7280;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Theme toggle button styles */
.theme-toggle {
    position: relative;
    overflow: hidden;
}

.theme-toggle svg {
    transition: all 0.3s ease;
}

.theme-toggle:hover svg {
    transform: scale(1.1);
}

/* Focus styles for accessibility */
.focus-ring:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #3b82f6;
}

.dark .focus-ring:focus {
    box-shadow: 0 0 0 2px #60a5fa;
}