/**
 * ARVAS Karotçuluk - Animasyonlar ve Efektler
 * Modern CSS animasyonları ve geçiş efektleri
 */

/* ====== GENEL ANIMASYON AYARLARI ====== */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ====== YÜKLEME ANIMASYONU ====== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-red), var(--primary-red-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease;
}

.loader-content {
    text-align: center;
    color: white;
}

.arvas-logo-loader {
    margin-bottom: 20px;
    animation: logoLoader 2s infinite ease-in-out;
}

.loader-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 30px;
    opacity: 0.9;
    animation: fadeInOut 2s infinite ease-in-out;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes logoLoader {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ====== HERO ANIMASYONLARI ====== */
.hero-content {
    animation: heroEnter 1.2s ease-out;
}

.hero-title {
    animation: slideInUp 1.5s ease-out;
}

.hero-subtitle {
    animation: slideInUp 1.8s ease-out;
}

.hero-buttons {
    animation: slideInUp 2.1s ease-out;
}

.hero-stats {
    animation: slideInUp 2.4s ease-out;
}

.scroll-indicator {
    animation: bounce 2s infinite;
    cursor: pointer;
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-indicator:hover {
    animation-play-state: paused;
    transform: translateX(-50%) translateY(-5px);
}

@keyframes heroEnter {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* ====== BUTON ANIMASYONLARI ====== */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

/* ====== KART ANIMASYONLARI ====== */
.service-card,
.portfolio-item,
.post-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(229, 62, 62, 0.15);
}

.service-card .service-icon {
    transition: all 0.4s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1);
    background: linear-gradient(45deg, var(--primary-red), var(--secondary-blue));
}

/* ====== FLOATING BUTONLAR ====== */
.whatsapp-float,
.phone-float {
    position: fixed;
    z-index: 1000;
    animation: floating 3s ease-in-out infinite;
}

.whatsapp-float {
    bottom: 20px;
    right: 20px;
}

.phone-float {
    bottom: 20px;
    left: 20px;
}

.whatsapp-btn,
.phone-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-size: 1.5rem;
}

.phone-btn {
    background: var(--primary-red);
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.3);
}

.whatsapp-btn:hover,
.phone-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.phone-btn:hover {
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.4);
}

.whatsapp-btn.bounce {
    animation: bounceButton 0.6s ease;
}

.whatsapp-text {
    position: absolute;
    right: 70px;
    background: #25D366;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

.whatsapp-float:hover .whatsapp-text {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes bounceButton {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ====== BACK TO TOP ====== */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 90px;
    width: 50px;
    height: 50px;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
    font-size: 1.2rem;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-red-dark);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(229, 62, 62, 0.3);
}

/* ====== HEADER ANIMASYONLARI ====== */
.header {
    transform: translateY(0);
    transition: all 0.3s ease;
}

.header.scrolled {
    transform: translateY(0);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.logo {
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.main-nav a {
    position: relative;
    overflow: hidden;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-red);
    transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.current-menu-item::after {
    width: 100%;
}

/* ====== MOBIL MENU ANIMASYONLARI ====== */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background: var(--dark-gray);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: white;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-nav-menu li {
    border-bottom: 1px solid #eee;
}

.mobile-nav-menu a {
    display: block;
    padding: 15px 20px;
    color: var(--dark-gray);
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-nav-menu a:hover {
    background: var(--light-gray);
    color: var(--primary-red);
    padding-left: 30px;
}

/* ====== SCROLL ANIMASYONLARI ====== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.animated {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.slide-in-left.animated {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
}

.slide-in-right.animated {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.slide-in-up.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ====== NOTIFICATION ANIMASYONLARI ====== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    padding: 15px 20px;
    z-index: 10000;
    transform: translateX(400px);
    transition: all 0.3s ease;
    max-width: 350px;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid #28a745;
}

.notification-error {
    border-left: 4px solid #dc3545;
}

.notification-warning {
    border-left: 4px solid #ffc107;
}

.notification-info {
    border-left: 4px solid #17a2b8;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.notification-close:hover {
    opacity: 1;
}

/* ====== FORM ANIMASYONLARI ====== */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-control {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
    transform: translateY(-2px);
}

.form-control.valid {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.05);
}

.form-control.invalid {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
    animation: shake 0.5s ease-in-out;
}

.field-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
    display: block;
    animation: slideInUp 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ====== SAYAÇ ANIMASYONLARI ====== */
.stat-item {
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: scale(1.05);
}

.stat-number {
    animation: countUp 2s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====== TESTIMONIAL SLIDER ====== */
.testimonials-slider {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.testimonial-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100px);
    transition: all 0.6s ease;
}

.testimonial-item.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* ====== HOVER EFEKTLERI ====== */
.service-card:hover .service-icon {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ====== RESPONSIVE ANIMASYONLAR ====== */
@media (max-width: 768px) {
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .whatsapp-float {
        bottom: 80px;
    }
    
    .phone-float.mobile-only {
        display: block;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ====== ACCESSIBILITY ANIMASYONLARI ====== */
.keyboard-navigation *:focus {
    outline: 2px solid var(--primary-red) !important;
    outline-offset: 2px !important;
}