/* Custom Styles for Anime Admin Dashboard */

/* Smooth transitions */
* {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb {
    background-color: #475569;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background-color: #64748b;
}

/* Line clamp utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Animation for toast */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Sidebar active state */
.nav-item.active {
    position: relative;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background-color: #8b5cf6;
    border-radius: 0 3px 3px 0;
}

/* Card hover effect */
.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}

/* Dropdown animation */
[id^="anime-menu-"] {
    animation: dropdownFade 0.15s ease-out;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Progress bar animation */
#progress-bar {
    transition: width 0.3s ease;
}

/* Modal backdrop */
#anime-modal,
#delete-modal {
    backdrop-filter: blur(4px);
}

/* Input focus ring */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Button hover effects */
button:not(:disabled):hover {
    transform: translateY(-1px);
}

button:not(:disabled):active {
    transform: translateY(0);
}

/* Table row hover */
table tbody tr:hover {
    background-color: rgba(139, 92, 246, 0.05);
}

.dark table tbody tr:hover {
    background-color: rgba(139, 92, 246, 0.1);
}

/* Loading spinner */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Image placeholder */
img[src=""] {
    background: linear-gradient(110deg, #f0f0f0 8%, #f8f8f8 18%, #f0f0f0 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
}

.dark img[src=""] {
    background: linear-gradient(110deg, #374151 8%, #4b5563 18%, #374151 33%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    to {
        background-position-x: -200%;
    }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    #sidebar {
        transform: translateX(-100%);
    }
    
    #sidebar.translate-x-0 {
        transform: translateX(0);
    }
    
    #main-content {
        margin-left: 0 !important;
    }
}

/* Print styles */
@media print {
    #sidebar,
    #mobile-menu-btn,
    .no-print {
        display: none !important;
    }
    
    #main-content {
        margin-left: 0 !important;
    }
}

/* Dark mode specific */
.dark .shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
}

.dark .shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

/* Custom checkbox/radio styling */
input[type="checkbox"],
input[type="radio"] {
    accent-color: #8b5cf6;
}

/* File input styling */
input[type="file"] {
    cursor: pointer;
}

/* Disabled state */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

/* Selection color */
::selection {
    background-color: rgba(139, 92, 246, 0.3);
    color: inherit;
}

/* Placeholder color */
::placeholder {
    color: #9ca3af;
}

.dark ::placeholder {
    color: #6b7280;
}

/* Chart container */
canvas {
    max-width: 100%;
    height: auto;
}

/* Badge styling */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Status badges */
.status-ongoing {
    background-color: #8b5cf6;
    color: white;
}

.status-end {
    background-color: #10b981;
    color: white;
}

.status-upcoming {
    background-color: #6b7280;
    color: white;
}

/* Toast container positioning */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Modal z-index stacking */
#anime-modal {
    z-index: 100;
}

#delete-modal {
    z-index: 101;
}

/* Form validation styles */
input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

input:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

/* Smooth page transitions */
.page-content {
    animation: pageFadeIn 0.3s ease-out;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover lift effect for cards */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
}

.dark .hover-lift:hover {
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass morphism effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
