/**
 * Mobile Touch Interactions - Minimalist
 * Tüm mobil cihazlar için dokunmatik geri bildirim
 */

/* ============================================
   1. GLOBAL TOUCH FEEDBACK
   ============================================ */

/* Tüm tıklanabilir elementler için smooth transition */
a, button, .btn, [role="button"],
.card, .product-box, .info-card,
input[type="submit"], input[type="button"],
.menu-item, .nav-link, .dropdown-item {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* Active state - hafif küçülme ve opacity */
@media (hover: none) and (pointer: coarse) {
    a:active, button:active, .btn:active,
    .card:active, .product-box:active,
    .info-card:active {
        transform: scale(0.97);
        opacity: 0.85;
    }

    /* Butonlar için özel */
    .btn:active, button:active {
        transform: scale(0.95);
    }

    /* Küçük butonlar için daha az scale */
    .btn-sm:active, .btn-icon:active {
        transform: scale(0.98);
    }
}

/* ============================================
   2. RIPPLE EFFECT CONTAINER
   ============================================ */

.ripple-container {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-animation 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

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

/* Dark ripple (beyaz arkaplanlar için) */
.ripple-dark {
    background: rgba(0, 0, 0, 0.1);
}

/* Light ripple (koyu arkaplanlar için) */
.ripple-light {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   3. SMOOTH SCROLL
   ============================================ */

html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* iOS momentum scrolling */
body, .scroll-container {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

/* ============================================
   4. CARD & BUTTON INTERACTIONS
   ============================================ */

/* Kartlar */
.card, .product-box, .info-card {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

@media (hover: none) and (pointer: coarse) {
    .card:active, .product-box:active, .info-card:active {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
}

/* Butonlar - renk değişimi */
@media (hover: none) and (pointer: coarse) {
    .btn-primary:active {
        background-color: #0056b3 !important;
    }

    .btn-success:active {
        background-color: #218838 !important;
    }

    .btn-danger:active {
        background-color: #c82333 !important;
    }
}

/* ============================================
   5. LINK INTERACTIONS
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    a:not(.btn):active {
        color: #0056b3;
        text-decoration: underline;
    }
}

/* ============================================
   6. FORM ELEMENTS
   ============================================ */

/* Input ve textarea için focus feedback */
input, textarea, select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: none) and (pointer: coarse) {
    input:focus, textarea:focus, select:focus {
        border-color: #326c3a !important;
        box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1) !important;
        outline: none;
    }
}

/* ============================================
   7. MENU & NAVIGATION
   ============================================ */

/* Nav links için position relative (ripple için gerekli) */
.nav-link, .mobile-menu a {
    position: relative;
    overflow: hidden;
}

@media (hover: none) and (pointer: coarse) {
    .nav-link:active, .menu-item:active {
        background-color: rgba(0, 0, 0, 0.05);
    }

    .dropdown-item:active {
        background-color: rgba(74, 124, 89, 0.1);
    }
}

/* ============================================
   8. SWIPE INDICATORS
   ============================================ */

.swipeable {
    touch-action: pan-y;
    cursor: grab;
}

.swipeable:active {
    cursor: grabbing;
}

/* Carousel için swipe cursor */
.splide, .carousel, .slider {
    touch-action: pan-y;
    cursor: grab;
}

.splide:active, .carousel:active, .slider:active {
    cursor: grabbing;
}

/* ============================================
   9. LOADING STATES
   ============================================ */

.loading {
    pointer-events: none;
    opacity: 0.6;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #326c3a;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ============================================
   10. PULL TO REFRESH (PLACEHOLDER)
   ============================================ */

.pull-to-refresh {
    position: relative;
}

.pull-to-refresh-indicator {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    transition: top 0.3s ease;
    opacity: 0;
}

.pull-to-refresh.pulling .pull-to-refresh-indicator {
    top: 10px;
    opacity: 1;
}

/* ============================================
   11. SKELETON LOADERS (SHIMMER)
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

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

/* ============================================
   12. ACCESSIBILITY & PERFORMANCE
   ============================================ */

/* Reduce motion için */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* GPU acceleration */
.accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Optimize scrolling */
.scroll-smooth {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* ============================================
   13. CUSTOM ACTIVE STATES
   ============================================ */

/* İlan kartları için özel */
@media (hover: none) and (pointer: coarse) {
    .ilan-card:active {
        transform: scale(0.98);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    /* Haber kartları */
    .news-card:active {
        transform: scale(0.98);
    }

    /* Mobil menü items */
    .mobile-menu-item:active {
        background-color: rgba(74, 124, 89, 0.1);
    }
}

/* ============================================
   14. TOUCH TARGET SIZES (Accessibility)
   ============================================ */

/* Minimum 44x44px touch target */
@media (hover: none) and (pointer: coarse) {
    /* Sadece gerçek butonlara ve linklere uygula */
    button:not(.splide__pagination__page):not(.slick-dots button):not([class*="pagination"]):not([class*="dot"]),
    .btn:not(.splide__pagination__page):not(.slick-dots .btn),
    a.btn,
    [role="button"]:not(.splide__pagination__page) {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Icon buttons */
    .btn-icon {
        width: 44px;
        height: 44px;
        padding: 0;
    }

    /* Pagination dots hariç tut */
    .splide__pagination__page,
    .slick-dots button,
    [class*="pagination"] button,
    [class*="dot"] {
        min-width: auto !important;
        min-height: auto !important;
    }
}
