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

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

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

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

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

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

/* Smooth Transitions */
.transition-colors {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* Theme Overrides - Force specific colors to prevent browser default bleeding */
:root {
    color-scheme: light;
    /* Default to light scheme */
}

/* Explicit Light Mode Defaults */
body {
    background-color: #f9fafb;
    /* gray-50 */
    color: #111827;
    /* gray-900 */
}

/* Explicit Dark Mode Overrides */
html.dark {
    color-scheme: dark;
}

html.dark body {
    background-color: #111827;
    /* gray-900 */
    color: #ffffff;
    /* white */
}

/* Dashboard Specifics */
.sidebar-active {
    background-color: rgb(243 244 246);
    /* gray-100 */
    color: rgb(17 24 39);
    /* gray-900 */
}

.dark .sidebar-active {
    background-color: rgb(55 65 81);
    /* gray-700 */
    color: white;
}

/* Glassmorphism utilities */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dark .glass {
    background: rgba(17, 24, 39, 0.7);
}

.glass-premium {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dark .glass-premium {
    background: rgba(31, 41, 55, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* More Dynamic Animated Mesh Gradient Background */
.mesh-gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #f0f4f8;
    background-image:
        radial-gradient(at 10% 10%, rgba(59, 130, 246, 0.2) 0px, transparent 40%),
        radial-gradient(at 90% 15%, rgba(99, 102, 241, 0.2) 0px, transparent 40%),
        radial-gradient(at 85% 90%, rgba(59, 130, 246, 0.2) 0px, transparent 40%),
        radial-gradient(at 15% 85%, rgba(99, 102, 241, 0.2) 0px, transparent 40%),
        radial-gradient(at 50% 50%, rgba(79, 70, 229, 0.15) 0px, transparent 50%);
    background-size: 200% 200%;
    animation: mesh-animation 12s ease-in-out infinite;
}

.dark .mesh-gradient-bg {
    background-color: #0f172a;
    background-image:
        radial-gradient(at 10% 10%, rgba(59, 130, 246, 0.15) 0px, transparent 40%),
        radial-gradient(at 90% 15%, rgba(99, 102, 241, 0.15) 0px, transparent 40%),
        radial-gradient(at 85% 90%, rgba(59, 130, 246, 0.15) 0px, transparent 40%),
        radial-gradient(at 15% 85%, rgba(99, 102, 241, 0.15) 0px, transparent 40%),
        radial-gradient(at 50% 50%, rgba(79, 70, 229, 0.1) 0px, transparent 50%);
}

@keyframes mesh-animation {
    0% {
        background-position: 0% 50%;
    }

    25% {
        background-position: 50% 100%;
    }

    50% {
        background-position: 100% 50%;
    }

    75% {
        background-position: 50% 0%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Float Animation */
@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    33% {
        transform: translateY(-15px) rotate(1deg);
    }

    66% {
        transform: translateY(5px) rotate(-1deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

.animate-float {
    animation: float 8s ease-in-out infinite;
}

/* Global Progress Bar */
#global-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(to right, #3b82f6, #6366f1);
    z-index: 9999;
    transition: width 0.3s ease, opacity 0.5s ease;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    pointer-events: none;
}

/* View Transitions API Refined - "Risk Yok" */
main {
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.4s ease;
    transform: translateY(0);
    filter: blur(0);
}

main.is-transitioning {
    opacity: 0;
    transform: translateY(15px);
    filter: blur(4px);
    pointer-events: none;
}

/* SPA Loading Overlay */
#spa-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.dark #spa-loading-overlay {
    background: rgba(17, 24, 39, 0.4);
}

#spa-loading-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.spa-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    border-top-color: #6366f1;
    animation: spa-spin 0.8s linear infinite;
}

@keyframes spa-spin {
    to { transform: rotate(360deg); }
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 300ms;
    animation-timing-function: ease-in-out;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
}

@keyframes fade-out {
    to {
        opacity: 0;
    }
}

/* Splash Screen Animations */
#splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes splash-pulse {
    0% { transform: scale(1); opacity: 0.2; }
    50% { transform: scale(1.4); opacity: 0.4; }
    100% { transform: scale(1); opacity: 0.2; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(-5%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
    50% { transform: translateY(0); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}

.splash-progress {
    transition: width 0.4s ease-in-out;
}

.animate-pulse {
    animation: splash-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
    animation: bounce 1s infinite;
}

/* Active State Navigation - Category Cards & Tabs */
.category-card, .tab-link {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card Active States - Removed hardcoded colors to allow Tailwind classes to work */
.category-card.is-active {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.dark .category-card.is-active {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

/* Specific Border Colors for Cards */
.category-card[data-filter="all"].is-active { border-color: #3b82f6 !important; }
.category-card[data-filter="analiz_bekliyor"].is-active { border-color: #a855f7 !important; }
.category-card[data-filter="uretimde"].is-active { border-color: #f59e0b !important; }
.category-card[data-filter="tamamlandi"].is-active { border-color: #10b981 !important; }

/* Tab Link Active States */
.tab-link.is-active {
    border-bottom: 3px solid currentColor !important;
    background-color: rgba(31, 41, 55, 0.05) !important;
    border-radius: 8px 8px 0 0;
    font-weight: 800;
}

.dark .tab-link.is-active {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

.tab-link[data-filter="all"].is-active { color: #3b82f6 !important; border-color: #3b82f6 !important; }
.tab-link[data-filter="yeni"].is-active { color: #3b82f6 !important; border-color: #3b82f6 !important; }
.tab-link[data-filter="isleme_alinan"].is-active { color: #6366f1 !important; border-color: #6366f1 !important; }
.tab-link[data-filter="analiz_bekliyor"].is-active { color: #a855f7 !important; border-color: #a855f7 !important; }
.tab-link[data-filter="uretimde"].is-active { color: #f59e0b !important; border-color: #f59e0b !important; }
.tab-link[data-filter="tasima_durumda"].is-active { color: #f97316 !important; border-color: #f97316 !important; }
.tab-link[data-filter="tamamlandi"].is-active { color: #10b981 !important; border-color: #10b981 !important; }
.tab-link[data-filter="diger"].is-active { color: #6b7280 !important; border-color: #6b7280 !important; }

/* Icon active states in tabs */
.tab-link.is-active i {
    color: inherit !important;
}

/* Sidebar Tooltip Mobil Düzeltmesi - Sonsuz Yükseklik Sorununu Giderir */
@media (max-width: 639px) {
    .sidebar-tooltip {
        display: none !important;
    }
}
