/* Touch Optimizasyonu CSS */

/* ===== BÜYÜK DOKUNMA ALANLARI ===== */

/* Mobil için optimize edilmiş butonlar */
.touch-btn {
    min-height: 44px; /* Apple'ın önerdiği minimum dokunma alanı */
    min-width: 44px;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 16px; /* Mobil için okunabilir font boyutu */
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.touch-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Farklı boyutlarda touch butonları */
.touch-btn-sm {
    min-height: 40px;
    min-width: 40px;
    padding: 10px 16px;
    font-size: 14px;
}

.touch-btn-lg {
    min-height: 56px;
    min-width: 56px;
    padding: 16px 24px;
    font-size: 18px;
}

.touch-btn-xl {
    min-height: 64px;
    min-width: 64px;
    padding: 20px 28px;
    font-size: 20px;
}

/* Touch buton varyantları */
.touch-btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.touch-btn-primary:active {
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.touch-btn-secondary {
    background: var(--card-bg);
    color: var(--primary-text);
    border: 2px solid var(--border-color);
}

.touch-btn-secondary:active {
    background: var(--odds-bg);
    border-color: var(--accent-color);
}

/* ===== HAPTIC FEEDBACK ===== */

/* Dokunma hissi için ripple efekti */
.touch-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, height 0.6s ease;
    pointer-events: none;
}

.touch-btn:active::before {
    width: 200px;
    height: 200px;
}

/* Haptic feedback için özel sınıflar */
.haptic-light {
    transition: all 0.1s ease;
}

.haptic-light:active {
    transform: scale(0.98);
}

.haptic-medium {
    transition: all 0.15s ease;
}

.haptic-medium:active {
    transform: scale(0.95);
}

.haptic-heavy {
    transition: all 0.2s ease;
}

.haptic-heavy:active {
    transform: scale(0.92);
}

/* ===== GESTURE NAVIGATION ===== */

/* Swipe gesture container */
.swipe-container {
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
}

.swipe-content {
    transition: transform 0.3s ease;
    will-change: transform;
}

/* Swipe directions */
.swipe-left .swipe-content {
    transform: translateX(-100%);
}

.swipe-right .swipe-content {
    transform: translateX(100%);
}

.swipe-up .swipe-content {
    transform: translateY(-100%);
}

.swipe-down .swipe-content {
    transform: translateY(100%);
}

/* Swipe indicators */
.swipe-indicator {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.swipe-indicator.show {
    opacity: 1;
}

.swipe-indicator.left {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.swipe-indicator.right {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.swipe-indicator.up {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.swipe-indicator.down {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

/* ===== TOUCH GESTURES ===== */

/* Pinch zoom container */
.pinch-container {
    touch-action: manipulation;
    overflow: hidden;
}

.pinch-content {
    transform-origin: center;
    transition: transform 0.1s ease;
}

/* Double tap container */
.double-tap-container {
    touch-action: manipulation;
}

/* Long press container */
.long-press-container {
    touch-action: manipulation;
}

/* ===== MOBIL OPTİMİZASYONLAR ===== */

/* Mobil için optimize edilmiş input alanları */
.touch-input {
    min-height: 48px;
    padding: 12px 16px;
    font-size: 16px; /* iOS'ta zoom'u önler */
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    -webkit-appearance: none;
}

.touch-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--odds-bg);
    outline: none;
}

/* Mobil için optimize edilmiş dropdown */
.touch-dropdown {
    min-height: 48px;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    color: var(--primary-text);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

/* Mobil için optimize edilmiş checkbox ve radio */
.touch-checkbox,
.touch-radio {
    min-width: 24px;
    min-height: 24px;
    margin: 8px;
    cursor: pointer;
}

/* Mobil için optimize edilmiş toggle switch */
.touch-toggle {
    position: relative;
    width: 60px;
    height: 34px;
    background: var(--border-color);
    border-radius: 17px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.touch-toggle.active {
    background: var(--accent-color);
}

.touch-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.touch-toggle.active::after {
    transform: translateX(26px);
}

/* ===== TOUCH ANİMASYONLARI ===== */

/* Touch bounce efekti */
@keyframes touchBounce {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.touch-bounce:active {
    animation: touchBounce 0.2s ease;
}

/* Touch ripple efekti */
@keyframes touchRipple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.touch-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: touchRipple 0.6s ease;
    pointer-events: none;
}

/* ===== RESPONSIVE TOUCH ===== */

@media (max-width: 768px) {
    /* Mobilde daha büyük dokunma alanları */
    .touch-btn {
        min-height: 48px;
        min-width: 48px;
        padding: 14px 22px;
        font-size: 16px;
    }
    
    .touch-btn-sm {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 18px;
        font-size: 15px;
    }
    
    .touch-btn-lg {
        min-height: 60px;
        min-width: 60px;
        padding: 18px 26px;
        font-size: 18px;
    }
    
    .touch-btn-xl {
        min-height: 72px;
        min-width: 72px;
        padding: 24px 32px;
        font-size: 20px;
    }
    
    /* Mobilde daha büyük input alanları */
    .touch-input {
        min-height: 52px;
        padding: 14px 18px;
        font-size: 16px;
    }
    
    /* Mobilde daha büyük toggle */
    .touch-toggle {
        width: 68px;
        height: 38px;
    }
    
    .touch-toggle::after {
        width: 34px;
        height: 34px;
    }
    
    .touch-toggle.active::after {
        transform: translateX(30px);
    }
}

@media (max-width: 480px) {
    /* Küçük ekranlarda maksimum dokunma alanları */
    .touch-btn {
        min-height: 52px;
        min-width: 52px;
        padding: 16px 24px;
        font-size: 16px;
    }
    
    .touch-input {
        min-height: 56px;
        padding: 16px 20px;
        font-size: 16px;
    }
}

/* ===== TOUCH UTILITIES ===== */

/* Touch disabled state */
.touch-disabled {
    pointer-events: none;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Touch loading state */
.touch-loading {
    pointer-events: none;
    opacity: 0.7;
}

.touch-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Touch success state */
.touch-success {
    background: var(--success-color) !important;
    color: white !important;
}

/* Touch error state */
.touch-error {
    background: var(--danger-color) !important;
    color: white !important;
}

/* Touch warning state */
.touch-warning {
    background: var(--warning-color) !important;
    color: white !important;
}
