/* ========================================
   TOUCH-FRIENDLY UI OPTİMİZASYONLARI
   Mobile Touch Experience Enhancement
   ======================================== */

/* ========== TOUCH TARGET OPTİMİZASYONU ========== */

/* Apple HIG ve Material Design standartlarına uygun minimum 44px touch targets */
.btn,
button,
.nav-link,
.dropdown-item,
.form-control,
.form-select,
.card-clickable,
.topic-card,
.session-card,
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="checkbox"],
input[type="radio"],
.custom-control-label::before,
.form-check-input {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

/* Özel buton stilleri */
.btn {
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.98);
}

.btn-sm {
    min-height: 40px;
    padding: 10px 16px;
    font-size: 14px;
}

.btn-lg {
    min-height: 52px;
    padding: 16px 24px;
    font-size: 18px;
}

/* ========== FORM ELEMENT OPTİMİZASYONU ========== */

/* iOS zoom engellemek için minimum 16px font-size */
.form-control,
.form-select,
input,
textarea,
select {
    font-size: 16px !important;
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #8E44AD;
    box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.12);
    outline: none;
}

/* Checkbox ve radio button optimizasyonu */
.form-check-input {
    width: 20px;
    height: 20px;
    margin-top: 0.125em;
    border: 2px solid #dee2e6;
    border-radius: 4px;
}

.form-check-input:checked {
    background-color: #8E44AD;
    border-color: #8E44AD;
}

.form-check-label {
    padding-left: 8px;
    font-size: 16px;
    line-height: 1.5;
    cursor: pointer;
}

/* ========== NAVIGATION OPTİMİZASYONU ========== */

.navbar-nav .nav-link {
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    margin: 2px 4px;
    transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    background-color: rgba(142, 68, 173, 0.12);
    color: #8E44AD;
}

.navbar-toggler {
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-color: transparent;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.12);
}

/* ========== CARD OPTİMİZASYONU ========== */

.card {
    border-radius: 12px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
    overflow: hidden;
}

.card-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.card-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.card-clickable:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card-body {
    padding: 20px;
}

.card-header {
    padding: 16px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

/* ========== DROPDOWN OPTİMİZASYONU ========== */

.dropdown-menu {
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
}

.dropdown-item {
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 0;
    transition: all 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(142, 68, 173, 0.12);
    color: #8E44AD;
}

/* ========== TABLE OPTİMİZASYONU ========== */

.table {
    font-size: 16px;
}

.table th,
.table td {
    padding: 16px 12px;
    vertical-align: middle;
}

.table-responsive {
    border-radius: 12px;
    overflow: hidden;
}

/* ========== MODAL OPTİMİZASYONU ========== */

.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
}

.btn-close {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    background-size: 16px;
}

/* ========== ALERT OPTİMİZASYONU ========== */

.alert {
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 16px;
    border: none;
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
}

/* ========== BADGE OPTİMİZASYONU ========== */

.badge {
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
}

/* ========== PROGRESS BAR OPTİMİZASYONU ========== */

.progress {
    height: 12px;
    border-radius: 6px;
    background-color: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    border-radius: 6px;
    transition: width 0.3s ease;
}

/* ========== PAGINATION OPTİMİZASYONU ========== */

.pagination .page-link {
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 8px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    color: #6c757d;
    transition: all 0.2s ease;
}

.pagination .page-link:hover,
.pagination .page-link:focus {
    background-color: rgba(142, 68, 173, 0.12);
    border-color: #8E44AD;
    color: #8E44AD;
}

.pagination .page-item.active .page-link {
    background-color: #8E44AD;
    border-color: #8E44AD;
    color: white;
}

/* ========== ACCORDION OPTİMİZASYONU ========== */

.accordion-button {
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    background-color: transparent;
    transition: all 0.2s ease;
}

.accordion-button:not(.collapsed) {
    background-color: rgba(142, 68, 173, 0.12);
    color: #8E44AD;
}

.accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.12);
}

.accordion-body {
    padding: 20px;
}

/* ========== TOAST OPTİMİZASYONU ========== */

.toast {
    border-radius: 12px;
    border: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.toast-header {
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.toast-body {
    padding: 16px;
    font-size: 16px;
}

/* ========== ÖZEL TOUCH FEEDBACK ========== */

/* Ripple effect for buttons */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::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.3s, height 0.3s;
}

.btn-ripple:active::before {
    width: 300px;
    height: 300px;
}

/* ========== ACCESSIBILITY İYİLEŞTİRMELERİ ========== */

/* Focus indicators */
*:focus {
    outline: 2px solid #8E44AD;
    outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #8E44AD;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
}

.skip-to-content:focus {
    top: 6px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn,
    .form-control,
    .card {
        border: 2px solid currentColor;
    }
}

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

/* ========== MOBİL SPECIFIC IMPROVEMENTS ========== */

@media (max-width: 767.98px) {
    /* Larger touch targets on mobile */
    .btn {
        min-height: 48px;
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .form-control,
    .form-select {
        min-height: 48px;
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .navbar-nav .nav-link {
        padding: 18px 20px;
        font-size: 18px;
    }
    
    /* Improved spacing for mobile */
    .card-body {
        padding: 16px;
    }
    
    .modal-body {
        padding: 20px 16px;
    }
    
    /* Better modal experience on mobile */
    .modal-dialog {
        margin: 16px;
    }
    
    .modal-fullscreen-sm-down {
        width: 100vw;
        max-width: none;
        height: 100%;
        margin: 0;
    }
    
    .modal-fullscreen-sm-down .modal-content {
        height: 100%;
        border: 0;
        border-radius: 0;
    }
}

/* ========== TABLET SPECIFIC IMPROVEMENTS ========== */

@media (min-width: 768px) and (max-width: 991.98px) {
    .btn {
        min-height: 46px;
        padding: 13px 20px;
    }
    
    .form-control,
    .form-select {
        min-height: 46px;
        padding: 13px 16px;
    }
}

/* ========== UTILITY CLASSES ========== */

/* Touch-friendly spacing */
.touch-spacing-sm { margin: 8px 0; }
.touch-spacing-md { margin: 16px 0; }
.touch-spacing-lg { margin: 24px 0; }

/* Touch-friendly padding */
.touch-padding-sm { padding: 8px; }
.touch-padding-md { padding: 16px; }
.touch-padding-lg { padding: 24px; }

/* Touch-friendly borders */
.touch-border { border: 2px solid #e9ecef; }
.touch-border-primary { border: 2px solid #8E44AD; }
.touch-border-success { border: 2px solid #28a745; }
.touch-border-warning { border: 2px solid #ffc107; }
.touch-border-danger { border: 2px solid #dc3545; }