/**
 * DC TEKNİK - UX Enhancements
 * Smooth transitions, animations ve kullanıcı deneyimi iyileştirmeleri
 * Mevcut kodları bozmadan, güvenli şekilde eklendi
 */

/* ========================================
   SMOOTH TRANSITIONS
   ======================================== */

/* Global smooth transitions */
* {
    transition-property: transform, opacity, background-color, border-color, color, box-shadow;
    transition-duration: 0.3s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Buttons için daha hızlı transition */
a, button {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   PAGE TRANSITIONS
   ======================================== */

.page-transition {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */

.scroll-fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   BUTTON ENHANCEMENTS
   ======================================== */

/* ========================================
   ENHANCED BUTTON HOVER EFFECTS
   ======================================== */

/* Base Button Styles - Enhanced */
.btn, .btn-primary, .btn-whatsapp, .btn-outline, 
button, .action-btn, .send-btn, .attach-btn {
    position: relative;
    overflow: hidden;
    transform: translateZ(0); /* GPU acceleration */
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backface-visibility: hidden;
    will-change: transform, box-shadow;
}

/* Ripple Effect - Enhanced */
.btn::before,
.btn-primary::before,
.btn-whatsapp::before,
button::before,
.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease-out, height 0.6s ease-out, opacity 0.6s ease-out;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

.btn:hover::before,
.btn-primary:hover::before,
.btn-whatsapp:hover::before,
button:hover::before,
.action-btn:hover::before {
    width: 400px;
    height: 400px;
    opacity: 1;
}

/* Shine/Shimmer Effect */
.btn::after,
.btn-primary::after,
.btn-whatsapp::after,
button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transition: left 0.8s ease;
    z-index: 1;
    pointer-events: none;
}

.btn:hover::after,
.btn-primary:hover::after,
.btn-whatsapp:hover::after,
button:hover::after {
    left: 100%;
}

/* Primary Button - Enhanced */
.btn-primary {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4),
                0 0 20px rgba(255, 107, 53, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ff8c42 0%, #ffaa5e 100%);
    transform: translateY(-4px) scale(1.05) rotateX(5deg);
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.6),
                0 0 40px rgba(255, 107, 53, 0.3),
                inset 0 2px 10px rgba(255, 255, 255, 0.2);
}

.btn-primary:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
    transition-duration: 0.15s;
}

/* WhatsApp Button - Enhanced */
.btn-whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4),
                0 0 20px rgba(37, 211, 102, 0.1);
}

.btn-whatsapp:hover {
    background: linear-gradient(135deg, #128c7e 0%, #25d366 100%);
    transform: translateY(-4px) scale(1.05) rotateX(5deg);
    box-shadow: 0 12px 35px rgba(37, 211, 102, 0.6),
                0 0 40px rgba(37, 211, 102, 0.3),
                inset 0 2px 10px rgba(255, 255, 255, 0.2);
    animation: whatsapp-pulse 2s ease-in-out infinite;
}

.btn-whatsapp:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    transition-duration: 0.15s;
}

@keyframes whatsapp-pulse {
    0%, 100% {
        box-shadow: 0 12px 35px rgba(37, 211, 102, 0.6),
                    0 0 40px rgba(37, 211, 102, 0.3),
                    inset 0 2px 10px rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 0 12px 35px rgba(37, 211, 102, 0.8),
                    0 0 60px rgba(37, 211, 102, 0.5),
                    inset 0 2px 10px rgba(255, 255, 255, 0.3);
    }
}

/* Outline Button - Enhanced */
.btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
}

.btn-outline::before {
    background: rgba(255, 255, 255, 0.1);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 35px rgba(255, 255, 255, 0.2),
                0 0 30px rgba(255, 255, 255, 0.1);
}

.btn-outline:active {
    transform: translateY(-1px) scale(1.02);
    transition-duration: 0.15s;
}

/* Button Text & Icons - Enhanced Animations */
.btn i,
.btn-primary i,
.btn-whatsapp i,
button i {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
}

.btn:hover i,
.btn-primary:hover i,
.btn-whatsapp:hover i,
button:hover i {
    transform: scale(1.2) translateY(-2px);
}

.btn-primary:hover i {
    animation: icon-bounce 0.6s ease-in-out;
}

.btn-whatsapp:hover i {
    animation: icon-wiggle 0.6s ease-in-out;
}

@keyframes icon-bounce {
    0%, 100% { transform: scale(1.2) translateY(-2px); }
    50% { transform: scale(1.3) translateY(-4px); }
}

@keyframes icon-wiggle {
    0%, 100% { transform: scale(1.2) translateY(-2px) rotate(0deg); }
    25% { transform: scale(1.2) translateY(-2px) rotate(-5deg); }
    75% { transform: scale(1.2) translateY(-2px) rotate(5deg); }
}

/* Button Text */
.btn span,
.btn-primary span,
.btn-whatsapp span {
    position: relative;
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn:hover span,
.btn-primary:hover span,
.btn-whatsapp:hover span {
    transform: translateY(-1px);
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.5);
}

/* Large Button Enhancements */
.btn-large {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.btn-large:hover {
    transform: translateY(-6px) scale(1.08) rotateX(8deg);
}

.btn-large:active {
    transform: translateY(-2px) scale(1.04);
}

/* Chat Widget Buttons */
.action-btn,
.send-btn,
.attach-btn {
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 107, 53, 0.5);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
}

.action-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.send-btn {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    color: white;
}

.send-btn:hover {
    background: linear-gradient(135deg, #ff8c42 0%, #ffaa5e 100%);
    transform: rotate(10deg) scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.5);
}

.send-btn:active {
    transform: rotate(0deg) scale(1.05);
    transition-duration: 0.1s;
}

.attach-btn:hover {
    transform: rotate(45deg) scale(1.1);
    background: rgba(255, 255, 255, 0.15);
}

.attach-btn:active {
    transform: rotate(0deg) scale(1.05);
}

/* Special Button Types */
.phone-btn:hover {
    animation: phone-ring 0.5s ease-in-out;
}

@keyframes phone-ring {
    0%, 100% { transform: rotate(0deg) scale(1.05); }
    25% { transform: rotate(-10deg) scale(1.1); }
    75% { transform: rotate(10deg) scale(1.1); }
}

.whatsapp-btn:hover {
    animation: whatsapp-shake 0.5s ease-in-out;
}

@keyframes whatsapp-shake {
    0%, 100% { transform: translateY(-3px) scale(1.05); }
    50% { transform: translateY(-3px) scale(1.1) rotate(5deg); }
}

.location-btn:hover {
    animation: location-pulse 1s ease-in-out infinite;
}

@keyframes location-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 107, 53, 0);
    }
}

/* Focus States for Accessibility */
.btn:focus,
.btn-primary:focus,
.btn-whatsapp:focus,
button:focus,
.action-btn:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 4px;
}

/* Disabled State */
.btn:disabled,
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Button Loading State */
.btn.loading {
    pointer-events: none;
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: button-spin 0.6s linear infinite;
}

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

/* ========================================
   CARD ANIMATIONS
   ======================================== */

.service-card,
.review-card,
.feature-card,
.stat-counter {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0); /* GPU acceleration */
}

.service-card:hover,
.review-card:hover,
.feature-card:hover,
.stat-counter:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

/* ========================================
   LOADING STATES
   ======================================== */

.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ff6b35;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.skeleton-loading {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: toast-slide-in 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toast.success {
    border-color: rgba(16, 185, 129, 0.5);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.5);
}

.toast.warning {
    border-color: rgba(251, 191, 36, 0.5);
}

.toast.info {
    border-color: rgba(59, 130, 246, 0.5);
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.fade-out {
    animation: toast-fade-out 0.3s ease-out forwards;
}

@keyframes toast-fade-out {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast-icon {
    font-size: 1.5rem;
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast.warning .toast-icon {
    color: #fbbf24;
}

.toast.info .toast-icon {
    color: #3b82f6;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: white;
}

.toast-message {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* ========================================
   SMOOTH SCROLL
   ======================================== */

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   MICRO-INTERACTIONS
   ======================================== */

/* Click Ripple Effect */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
    z-index: 10;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Button Hovered State */
.button-hovered {
    /* This class is added via JS for additional control */
}

/* Pulse animation */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Shake animation */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* ========================================
   NAVIGATION ENHANCEMENTS
   ======================================== */

.nav-menu li a {
    position: relative;
    transition: all 0.3s ease;
}

.nav-menu li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #ff6b35;
    transition: width 0.3s ease;
}

.nav-menu li a:hover::after {
    width: 100%;
}

/* ========================================
   FORM ENHANCEMENTS
   ======================================== */

input, textarea, select {
    transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

/* ========================================
   FLOATING ANIMATION
   ======================================== */

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

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ========================================
   RESPONSIVE PERFORMANCE
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .scroll-fade-in,
    .scroll-slide-left,
    .scroll-slide-right,
    .scroll-scale {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATION
   ======================================== */

/* GPU acceleration için will-change */
.scroll-fade-in,
.scroll-slide-left,
.scroll-slide-right,
.scroll-scale,
.btn,
.service-card {
    will-change: transform, opacity;
}

/* Animasyon bittikten sonra will-change kaldır */
.scroll-fade-in.visible,
.scroll-slide-left.visible,
.scroll-slide-right.visible,
.scroll-scale.visible {
    will-change: auto;
}

