/* ===== MODERN ADMIN THEME ===== */

/* Global Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(37, 99, 235, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.6);
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    border-radius: 4px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1e40af, #0891b2);
}

/* Selection Styling */
::selection {
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    color: white;
}

::-moz-selection {
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    color: white;
}

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Link Hover Effects */
a:not(.btn):not(.badge):hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Input Focus Glow */
input:focus,
select:focus,
textarea:focus {
    animation: none;
}

/* Card Entrance Animation */
.card {
    animation: fadeInScale 0.5s ease;
}

/* Button Ripple Effect */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    opacity: 0;
}

.btn:active::after {
    width: 300px;
    height: 300px;
    opacity: 0.3;
}

/* Loading Spinner Animation */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Confetti-like particles */
.particle {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
        opacity: 1;
    }
    50% {
        transform: translateY(-20px);
        opacity: 0.7;
    }
}

/* Status Indicator Pulse */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Skeleton Loader Animation */
@keyframes skeleton {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 1000px 100%;
    animation: skeleton 2s infinite;
    border-radius: 8px;
    height: 20px;
}

/* Tooltip Styling */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    margin-bottom: 8px;
    animation: fadeInUp 0.3s ease;
    z-index: 1000;
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% - 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #0f172a;
    animation: fadeIn 0.3s ease;
    z-index: 1000;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    /* Reduce animations on mobile for better performance */
    * {
        transition: none;
    }

    .card {
        animation: none;
    }

    [data-tooltip]::after,
    [data-tooltip]::before {
        display: none;
    }
}

/* Dark Mode Support (Future) */
@media (prefers-color-scheme: dark) {
    ::-webkit-scrollbar-track {
        background: #1e293b;
    }

    ::selection {
        background: linear-gradient(135deg, #3b82f6, #0ea5e9);
    }
}

/* Print Styles */
@media print {
    .admin-sidebar,
    .admin-topbar,
    .btn,
    [class*="action-"] {
        display: none !important;
    }

    body {
        background: white;
    }

    .admin-main {
        margin-left: 0;
    }

    .card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Visible for Keyboard Navigation */
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: more) {
    .card {
        border-width: 2px;
    }

    .btn {
        font-weight: 900;
    }
}

/* Form validation */
.error-message {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
