/* Background image with theme-aware overlay */
body {
    background-image: url('../assets/bg.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    transition: background-image 0.5s ease-in-out;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: rgba(255, 255, 255, 0.03);
    transition: background-color 0.5s ease-in-out;
}

.dark body::before {
    background-color: rgba(15, 23, 42, 0.88);
    filter: grayscale(100%);
    transition: background-color 0.5s ease-in-out, filter 0.5s ease-in-out;
}

/* Smooth transitions for interactive elements */
button, select, textarea, a {
    transition: all 0.2s ease-in-out;
}

/* Dark mode nav/footer adjustments */
.dark nav, .dark footer {
    background-color: rgba(15, 23, 42, 0.7);
}

nav, footer {
    transition: background-color 0.5s ease-in-out;
}

/* Title styling */
#mid-title {
    color: #2563eb;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
}

.dark #mid-title {
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Toast notification */
#notification {
    animation: slide-in 0.3s ease-out;
}

/* Result animations */
@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Custom scrollbar for textarea */
textarea::-webkit-scrollbar {
    width: 6px;
}

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

textarea::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

.dark textarea::-webkit-scrollbar-thumb {
    background-color: rgba(75, 85, 99, 0.5);
}

/* Focus visible improvements */
button:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Selection color */
::selection {
    background-color: rgba(37, 99, 235, 0.2);
}

.dark ::selection {
    background-color: rgba(37, 99, 235, 0.4);
}
