/* Admin-v2 Custom Styles */

/* Loading spinner animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Modal backdrop blur */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* Toast animations */
.toast-enter {
    transform: translateX(100%);
    opacity: 0;
}

.toast-enter-active {
    transform: translateX(0);
    opacity: 1;
    transition: all 0.3s ease-out;
}

.toast-exit {
    transform: translateX(0);
    opacity: 1;
}

.toast-exit-active {
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-in;
}

/* Card hover effects */
.card-hover {
    transition: all 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-active {
    background-color: #dcfce7;
    color: #166534;
}

.status-inactive {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-featured {
    background-color: #ddd6fe;
    color: #5b21b6;
}

/* Table styles */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-sticky-header th {
    position: sticky;
    top: 0;
    background-color: #f8fafc;
    z-index: 10;
}

/* Form enhancements */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-error {
    color: #dc2626;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Button variants */
.btn-primary {
    background-color: #6366f1;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.btn-primary:hover {
    background-color: #5048e5;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #d1d5db;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

/* Loading states */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsive utilities */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }

    .mobile-full {
        width: 100% !important;
    }

    .mobile-block {
        display: block !important;
    }

    .mobile-flex {
        display: flex !important;
    }

    .mobile-grid {
        display: grid !important;
    }

    .mobile-text-center {
        text-align: center !important;
    }

    .mobile-text-left {
        text-align: left !important;
    }

    .mobile-justify-center {
        justify-content: center !important;
    }

    .mobile-justify-between {
        justify-content: space-between !important;
    }

    .mobile-items-center {
        align-items: center !important;
    }

    .mobile-flex-col {
        flex-direction: column !important;
    }

    .mobile-space-x-0 > * + * {
        margin-left: 0 !important;
    }

    .mobile-space-y-2 > * + * {
        margin-top: 0.5rem !important;
    }

    .mobile-p-2 {
        padding: 0.5rem !important;
    }

    .mobile-p-4 {
        padding: 1rem !important;
    }

    .mobile-px-2 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .mobile-px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .mobile-py-2 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    .mobile-m-0 {
        margin: 0 !important;
    }

    .mobile-mb-2 {
        margin-bottom: 0.5rem !important;
    }

    .mobile-mb-4 {
        margin-bottom: 1rem !important;
    }

    .mobile-w-full {
        width: 100% !important;
    }

    .mobile-h-auto {
        height: auto !important;
    }

    .mobile-overflow-x-auto {
        overflow-x: auto !important;
    }

    .mobile-text-sm {
        font-size: 0.875rem !important;
    }

    .mobile-text-xs {
        font-size: 0.75rem !important;
    }
}

/* Mobile-specific styles */
@media (max-width: 640px) {
    /* Sidebar mobile styles */
    .sidebar-mobile {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .sidebar-mobile.open {
        transform: translateX(0);
    }

    /* Main content mobile adjustments */
    .main-content-mobile {
        margin-left: 0 !important;
    }

    /* Header mobile adjustments */
    .header-mobile {
        padding: 1rem !important;
    }

    .header-mobile .flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Search bar mobile */
    .search-mobile {
        width: 100% !important;
        max-width: none !important;
    }

    /* User menu mobile */
    .user-menu-mobile {
        position: relative;
    }

    .user-menu-mobile .absolute {
        position: static !important;
        box-shadow: none !important;
        border: 1px solid #e5e7eb !important;
        margin-top: 0.5rem !important;
    }

    /* Table mobile styles */
    .table-mobile {
        font-size: 0.875rem;
    }

    .table-mobile th,
    .table-mobile td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }

    .table-mobile th {
        font-size: 0.75rem;
    }

    /* Card mobile styles */
    .card-mobile {
        margin-bottom: 1rem;
        padding: 1rem;
    }

    .card-mobile .flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Form mobile styles */
    .form-mobile .form-group {
        margin-bottom: 1rem;
    }

    .form-mobile .form-input {
        padding: 0.75rem;
        font-size: 1rem; /* Prevent zoom on iOS */
    }

    .form-mobile .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Modal mobile styles */
    .modal-mobile {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }

    .modal-mobile .modal-content {
        padding: 1rem;
    }

    /* Toast mobile styles */
    .toast-mobile {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }

    /* Grid mobile adjustments */
    .grid-mobile {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Stats cards mobile */
    .stats-mobile .grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }

    .stats-mobile .card {
        padding: 0.75rem !important;
    }

    .stats-mobile .text-2xl {
        font-size: 1.25rem !important;
    }

    .stats-mobile .text-sm {
        font-size: 0.75rem !important;
    }

    /* Login form mobile */
    .login-mobile {
        padding: 1rem !important;
    }

    .login-mobile .max-w-md {
        max-width: none !important;
        width: 100% !important;
    }

    /* Navigation mobile */
    .nav-mobile {
        padding: 1rem !important;
    }

    .nav-mobile a {
        padding: 0.75rem 1rem !important;
        font-size: 1rem !important;
    }
}

/* Tablet styles */
@media (min-width: 641px) and (max-width: 1024px) {
    .tablet-grid-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .tablet-grid-3 {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .tablet-hidden {
        display: none !important;
    }
}

/* Large screen styles */
@media (min-width: 1025px) {
    .desktop-grid-4 {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    .print-full-width {
        width: 100% !important;
    }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}