:root {
    --primary: #ff0000;
    --primary-dark: #cc0000;
    --secondary: #282828;
    --light: #f9f9f9;
    --dark: #212121;
}

* {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: background-color 0.3s ease;
    overflow-x: hidden;
}

.dark {
    background-color: var(--dark);
    color: var(--light);
}

.dark .card {
    background-color: #333;
    border-color: #444;
}

.dark input {
    background-color: #444;
    color: white;
    border-color: #555;
}

.dark .btn-primary {
    background-color: var(--primary-dark);
}

/* Enhanced dark mode styles */
.dark .bg-gray-50 {
    background-color: var(--dark);
}

.dark .bg-white {
    background-color: #333;
}

.dark .text-gray-600 {
    color: #a0aec0;
}

.dark .text-gray-500 {
    color: #718096;
}

.dark .border-gray-300 {
    border-color: #4a5568;
}

.dark .bg-gray-100 {
    background-color: #2d3748;
}

.dark .hover\:bg-gray-50:hover {
    background-color: #2d3748;
}

.dark .divide-gray-200 {
    border-color: #4a5568;
}

.dark .bg-gray-50 {
    background-color: #2d3748;
}

.dark .hover\:bg-gray-700:hover {
    background-color: #4a5568;
}

.dark .hover\:text-red-400:hover {
    color: #f56565;
}

.dark .hover\:text-red-800:hover {
    color: #c53030;
}

.dark .bg-yellow-100 {
    background-color: #744210;
}

.dark .text-yellow-800 {
    color: #f6e05e;
}

.dark .bg-yellow-800 {
    background-color: #744210;
}

.dark .text-yellow-100 {
    color: #f6e05e;
}

.dark .bg-gray-200 {
    background-color: #4a5568;
}

.dark .hover\:bg-gray-300:hover {
    background-color: #718096;
}

.dark .bg-gray-600 {
    background-color: #4a5568;
}

.dark .hover\:bg-gray-500:hover {
    background-color: #718096;
}

.dark .text-gray-900 {
    color: #f7fafc;
}

.dark .text-gray-400 {
    color: #a0aec0;
}

.dark .bg-gray-700 {
    background-color: #2d3748;
}

.dark .hover\:bg-gray-700:hover {
    background-color: #4a5568;
}

.dark .divide-gray-700 {
    border-color: #4a5568;
}

.dark .bg-gray-800 {
    background-color: #1a202c;
}

.dark .hover\:bg-gray-800:hover {
    background-color: #2d3748;
}

.dark .text-gray-300 {
    color: #e2e8f0;
}

.dark .text-gray-400 {
    color: #a0aec0;
}

.dark .text-gray-500 {
    color: #718096;
}

.dark .text-gray-600 {
    color: #a0aec0;
}

.dark .text-gray-700 {
    color: #cbd5e0;
}

.dark .text-gray-800 {
    color: #e2e8f0;
}

.dark .text-gray-900 {
    color: #f7fafc;
}

.dark .border-gray-600 {
    border-color: #4a5568;
}

.dark .focus\:ring-red-500:focus {
    --tw-ring-color: #f56565;
}

.dark .shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

.dark .shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.thumbnail-item {
    transition: transform 0.2s;
    overflow: visible;
}

.card {
    overflow: visible;
}

.thumbnail-item:hover {
    transform: scale(1.03);
}

.loader {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid var(--primary);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 400px;
    height: 100vh;
    background-color: white;
    transition: right 0.3s ease-in-out;
    z-index: 1000;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
}

.dark .mobile-menu {
    background-color: #1a202c;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out;
    z-index: 999;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Toast Notification Styles */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--secondary);
    color: var(--light);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background-color: #10B981;
}

.toast.error {
    background-color: #EF4444;
}

.dark .toast {
    background-color: #1F2937;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.dark .toast.success {
    background-color: #059669;
}

.dark .toast.error {
    background-color: #DC2626;
}

/* Scroll Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger animation delays */
.fade-in-up.delay-100 { transition-delay: 0.1s; }
.fade-in-up.delay-200 { transition-delay: 0.2s; }
.fade-in-up.delay-300 { transition-delay: 0.3s; }
.fade-in-up.delay-400 { transition-delay: 0.4s; }
.fade-in-up.delay-500 { transition-delay: 0.5s; }

/* Smooth scroll reveal */
.reveal {
    position: relative;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Navigation Dropdown Styles */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    min-width: 280px;
    padding: 1rem 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dark .nav-dropdown-menu {
    background: #1a202c;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.active .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-dropdown-item:hover {
    background: #f9fafb;
    color: #dc2626;
    border-left-color: #dc2626;
    padding-left: 1.75rem;
}

.dark .nav-dropdown-item {
    color: #e5e7eb;
}

.dark .nav-dropdown-item:hover {
    background: #2d3748;
    color: #f87171;
    border-left-color: #f87171;
}

.nav-dropdown-item i {
    width: 24px;
    margin-right: 0.75rem;
    text-align: center;
    font-size: 1.1rem;
}

.nav-dropdown-item span {
    white-space: nowrap;
}

/* Tool Grid in Dropdown */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
    padding: 0.5rem;
}

/* Mobile Responsive Improvements */
@media (max-width: 768px) {
    .nav-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 0;
        background: transparent;
    }
    
    .dark .nav-dropdown-menu {
        background: transparent;
    }
    
    .nav-dropdown-item {
        border-left: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        padding: 1rem 1.5rem;
    }
    
    .dark .nav-dropdown-item {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* Enhanced Card Hover Effects */
.card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dark .card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Button Enhancements */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

/* Loading Animation Enhancement */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Smooth Header Sticky Effect */
nav {
    transition: all 0.3s ease;
}

nav.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dark nav.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Footer Enhancements */
footer {
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.02));
}

.dark footer {
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.2));
}

/* Tool Link Styles */
.tool-link {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.6rem;
    margin: 0.2rem;
    background: #f3f4f6;
    border-radius: 0.5rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.tool-link:hover {
    background: #dc2626;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.3);
}

.dark .tool-link {
    background: #2d3748;
    color: #e5e7eb;
}

.dark .tool-link:hover {
    background: #dc2626;
    color: white;
}

.tool-link i {
    margin-right: 0.35rem;
    font-size: 0.875rem;
}

/* Attention helpers */
.attention-pulse {
    animation: attentionPulse 0.8s ease-in-out infinite;
}

.attention-shake {
    animation: attentionShake 0.35s ease-in-out 4;
}

@keyframes attentionPulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

@keyframes attentionShake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-6px); }
    30% { transform: translateX(6px); }
    45% { transform: translateX(-5px); }
    60% { transform: translateX(5px); }
    75% { transform: translateX(-4px); }
    90% { transform: translateX(4px); }
}