/* ========================================
   MOBİL RESPONSİVE OPTİMİZASYONU
   Mobile-First CSS Yaklaşımı
   ======================================== */

/* ========== TEMEL MOBİL STILLER ========== */

/* Mobile-first base styles */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ========== TOUCH-FRIENDLY UI ELEMENTS ========== */

/* Minimum touch target size: 44px x 44px (Apple HIG) */
.btn, 
button, 
.nav-link, 
.dropdown-item,
.form-control,
.form-select,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    min-height: 38px;
    min-width: 38px;
    padding: 10px 14px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Improved tap targets for mobile */
.navbar-nav .nav-link {
    padding: 12px 14px;
    font-size: 15px;
    line-height: 1.2;
}

/* Form elements optimization */
.form-control,
.form-select {
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 8px;
    padding: 10px 12px;
}

/* Card touch improvements */
.card {
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
}

.card-body {
    padding: 20px;
}

/* ========== MOBİL NAVIGATION ========== */

.navbar-toggler {
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
}

.navbar-collapse {
    margin-top: 16px;
}

.navbar-nav {
    gap: 8px;
}

/* ========== MOBİL TYPOGRAPHY ========== */

/* Base mobile typography */
h1 { font-size: 1.75rem; line-height: 1.2; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; line-height: 1.3; margin-bottom: 0.875rem; }
h3 { font-size: 1.25rem; line-height: 1.4; margin-bottom: 0.75rem; }
h4 { font-size: 1.125rem; line-height: 1.4; margin-bottom: 0.625rem; }
h5 { font-size: 1rem; line-height: 1.5; margin-bottom: 0.5rem; }
h6 { font-size: 0.875rem; line-height: 1.5; margin-bottom: 0.5rem; }

p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* ========== MOBİL LAYOUT ========== */

.container,
.container-fluid {
    padding-left: 16px;
    padding-right: 16px;
}

.row {
    margin-left: -8px;
    margin-right: -8px;
}

.col,
[class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
}

/* ========== MOBİL SPACING ========== */

.mb-mobile-1 { margin-bottom: 0.25rem !important; }
.mb-mobile-2 { margin-bottom: 0.5rem !important; }
.mb-mobile-3 { margin-bottom: 1rem !important; }
.mb-mobile-4 { margin-bottom: 1.5rem !important; }
.mb-mobile-5 { margin-bottom: 3rem !important; }

.mt-mobile-1 { margin-top: 0.25rem !important; }
.mt-mobile-2 { margin-top: 0.5rem !important; }
.mt-mobile-3 { margin-top: 1rem !important; }
.mt-mobile-4 { margin-top: 1.5rem !important; }
.mt-mobile-5 { margin-top: 3rem !important; }

.p-mobile-1 { padding: 0.25rem !important; }
.p-mobile-2 { padding: 0.5rem !important; }
.p-mobile-3 { padding: 1rem !important; }
.p-mobile-4 { padding: 1.5rem !important; }
.p-mobile-5 { padding: 3rem !important; }

/* ========== TABLET BREAKPOINT (768px+) ========== */
@media (min-width: 768px) {
    /* Typography scaling */
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.875rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    
    /* Container adjustments */
    .container,
    .container-fluid {
        padding-left: 24px;
        padding-right: 24px;
    }
    
    .row {
        margin-left: -12px;
        margin-right: -12px;
    }
    
    .col,
    [class*="col-"] {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* Card improvements */
    .card-body {
        padding: 24px;
    }
}

/* ========== DESKTOP BREAKPOINT (992px+) ========== */
@media (min-width: 992px) {
    /* Typography scaling */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.75rem; }
    h4 { font-size: 1.5rem; }
    
    /* Container adjustments */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .row {
        margin-left: -15px;
        margin-right: -15px;
    }
    
    .col,
    [class*="col-"] {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Navigation improvements */
    .navbar-nav .nav-link {
        padding: 8px 16px;
    }
    
    .navbar-collapse {
        margin-top: 0;
    }
}

/* ========== LARGE DESKTOP BREAKPOINT (1200px+) ========== */
@media (min-width: 1200px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.25rem; }
    h3 { font-size: 1.875rem; }
    h4 { font-size: 1.625rem; }
}

/* ========== MOBİL PERFORMANCE OPTİMİZASYONLARI ========== */

/* Reduce animations on mobile for better performance */
@media (max-width: 767.98px) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    /* Respect user's motion preferences */
    @media (prefers-reduced-motion: no-preference) {
        *,
        *::before,
        *::after {
            animation-duration: revert !important;
            animation-iteration-count: revert !important;
            transition-duration: revert !important;
        }
    }
}

/* ========== ACCESSIBILITY İYİLEŞTİRMELERİ ========== */

/* Focus indicators for keyboard navigation */
.btn:focus,
.form-control:focus,
.form-select:focus,
.nav-link:focus {
    outline: 2px solid #8E44AD;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 1px solid currentColor;
    }
}

/* ========== UTILITY CLASSES ========== */

/* Mobile visibility utilities */
.d-mobile-none { display: none !important; }
.d-mobile-block { display: block !important; }
.d-mobile-inline { display: inline !important; }
.d-mobile-inline-block { display: inline-block !important; }
.d-mobile-flex { display: flex !important; }

@media (min-width: 768px) {
    .d-tablet-none { display: none !important; }
    .d-tablet-block { display: block !important; }
    .d-tablet-inline { display: inline !important; }
    .d-tablet-inline-block { display: inline-block !important; }
    .d-tablet-flex { display: flex !important; }
}

@media (min-width: 992px) {
    .d-desktop-none { display: none !important; }
    .d-desktop-block { display: block !important; }
    .d-desktop-inline { display: inline !important; }
    .d-desktop-inline-block { display: inline-block !important; }
    .d-desktop-flex { display: flex !important; }
}

/* Text alignment utilities */
.text-mobile-center { text-align: center !important; }
.text-mobile-left { text-align: left !important; }
.text-mobile-right { text-align: right !important; }

@media (min-width: 768px) {
    .text-tablet-center { text-align: center !important; }
    .text-tablet-left { text-align: left !important; }
    .text-tablet-right { text-align: right !important; }
}

@media (min-width: 992px) {
    .text-desktop-center { text-align: center !important; }
    .text-desktop-left { text-align: left !important; }
    .text-desktop-right { text-align: right !important; }
}
