/* RelatoUFO - Custom Styles */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 12, 41, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Smooth transitions - Only on interactive elements for better performance */
a,
button,
input,
textarea,
select,
.transition {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

/* Focus states */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 2px #667eea;
    border-color: #667eea;
}

/* Fix for Select Options (browser default handling) */
select option {
    background-color: #0f0c29;
    /* Dark background matches the theme */
    color: white;
}

/* Loading animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Pulse animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Skeleton loading */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Star rating */
.stars {
    display: inline-flex;
    gap: 0.25rem;
}

.star {
    cursor: pointer;
    color: #4B5563;
    transition: color 0.2s;
}

.star:hover,
.star.active {
    color: #FBBF24;
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 500px;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.toast-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10B981;
    color: #D1FAE5;
}

.toast-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #EF4444;
    color: #FEE2E2;
}

.toast-info {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid #3B82F6;
    color: #DBEAFE;
}

/* Modal backdrop */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal {
    background: rgba(15, 12, 41, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 0.25rem;
}

.badge-primary {
    background: rgba(102, 126, 234, 0.2);
    color: #A5B4FC;
    border: 1px solid #667EEA;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #6EE7B7;
    border: 1px solid #10B981;
}

.badge-warning {
    background: rgba(251, 191, 36, 0.2);
    color: #FCD34D;
    border: 1px solid #FBBF24;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
    border: 1px solid #EF4444;
}

/* Tooltip */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: rgba(15, 12, 41, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: white;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 9999;
    margin-bottom: 0.5rem;
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .glass-effect,
    header,
    footer,
    nav,
    .no-print {
        display: none !important;
    }
}

/* ========================================
   PAGE TRANSITION ANIMATIONS
   ======================================== */

/* Page fade transition */
.page-transitioning {
    pointer-events: none;
}

.page-transitioning #main-content {
    animation: pageFadeOut 0.3s ease-out forwards;
}

@keyframes pageFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Content slide-up animation for elements */
.animate-slide-up {
    animation: slideUp 0.6s ease-out forwards;
}

.animate-slide-up-delay-1 {
    animation: slideUp 0.6s ease-out 0.1s forwards;
    opacity: 0;
}

.animate-slide-up-delay-2 {
    animation: slideUp 0.6s ease-out 0.2s forwards;
    opacity: 0;
}

.animate-slide-up-delay-3 {
    animation: slideUp 0.6s ease-out 0.3s forwards;
    opacity: 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale-in animation */
.animate-scale-in {
    animation: scaleIn 0.4s ease-out forwards;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide-in from left/right */
.animate-slide-left {
    animation: slideLeft 0.5s ease-out forwards;
}

.animate-slide-right {
    animation: slideRight 0.5s ease-out forwards;
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Page transition loading bar */
#page-transition-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    z-index: 99999;
    transition: width 0.3s ease;
    animation: gradientMove 1.5s ease infinite;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.8), 0 0 20px rgba(118, 75, 162, 0.6);
}

#page-transition-loader.loading {
    width: 70%;
}

#page-transition-loader.complete {
    width: 100%;
    transition: width 0.2s ease;
}

#page-transition-loader.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

@keyframes gradientMove {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Stagger animation for lists */
.stagger-children > * {
    opacity: 0;
    animation: slideUp 0.5s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(9) { animation-delay: 0.45s; }
.stagger-children > *:nth-child(10) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(n+11) { animation-delay: 0.55s; }

/* Glow pulse effect */
.animate-glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.6), 0 0 40px rgba(118, 75, 162, 0.4);
    }
}

/* Hover lift effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Smooth scroll for anchors */
html {
    scroll-behavior: smooth;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}