/* ============================================
   Theme Toggle Button - Modern & Digital
   ============================================ */

.theme-toggle {
    position: relative;
    width: 52px; /* Biraz daha dar */
    height: 28px !important; /* Daha ince: 32px -> 28px */
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: 14px; /* Height'a göre ayarlandı */
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    padding: 2px !important; /* Padding azaltıldı: 3px -> 2px */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px;
}

.theme-toggle:hover::before {
    opacity: 0.1;
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 16px rgba(0, 255, 136, 0.2);
    transform: scale(1.05);
}

.theme-toggle-slider {
    position: relative;
    width: 24px !important; /* Daha küçük: 26px -> 24px */
    height: 24px !important; /* Daha küçük: 26px -> 24px */
    background: var(--accent-primary);
    border-radius: 50%;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 255, 136, 0.4);
    z-index: 1;
}

[data-theme="light"] .theme-toggle-slider {
    transform: translateX(22px) !important; /* Yeni width'e göre ayarlandı: 24px -> 22px */
    background: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(0, 204, 102, 0.4);
}

.theme-toggle-icon {
    width: 16px;
    height: 16px;
    position: absolute;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.theme-toggle-icon.sun {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

.theme-toggle-icon.moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .theme-toggle-icon.sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .theme-toggle-icon.moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

/* SVG Icons */
.theme-toggle-icon svg {
    width: 100%;
    height: 100%;
    fill: var(--text-primary);
    stroke: var(--text-primary);
}

/* Navbar Integration */
.theme-toggle-wrapper {
    display: flex;
    align-items: center;
    margin-left: var(--spacing-md);
    padding: 0 !important; /* Padding kaldırıldı */
    height: auto !important; /* Height otomatik */
}

.navbar .theme-toggle {
    margin-left: 0;
    margin-top: 0 !important; /* Üst margin kaldırıldı */
    margin-bottom: 0 !important; /* Alt margin kaldırıldı */
}

/* Mobile Menu Integration */
.theme-toggle-mobile-wrapper {
    display: flex;
    justify-content: center;
    padding: var(--spacing-lg) 0;
    border-top: 1px solid var(--glass-border);
    margin-top: var(--spacing-md);
}

.nav-menu-mobile .theme-toggle {
    margin: 0 auto;
    display: flex;
}

/* Accessibility */
.theme-toggle:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.theme-toggle:focus:not(:focus-visible) {
    outline: none;
}

/* Animation for theme change */
@keyframes themePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.theme-toggle.animating .theme-toggle-slider {
    animation: themePulse 0.3s ease;
}

