/* =============================================
   KAPSAMLI MOBIL RESPONSIVE CSS
   Tum sayfalarda kullanilir
   ============================================= */

/* ========== 1. GENEL MOBIL AYARLAR ========== */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    word-wrap: break-word;
    -webkit-overflow-scrolling: touch;
}

img {
    max-width: 100%;
    height: auto;
}

/* Touch-friendly butonlar */
button, a, input, select, textarea {
    touch-action: manipulation;
}

/* ========== 2. CONTAINER & GRID ========== */
.container {
    width: 100%;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    margin: 0 auto;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -8px;
    margin-right: -8px;
}

.row > [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
}

/* ========== 3. NAVBAR MOBIL ========== */
@media (max-width: 768px) {
    .navbar, .nav, ._mn {
        padding: 0 8px !important;
    }
    
    .navbar-brand, ._mn-logo {
        font-size: 1.1rem !important;
    }
    
    .navbar-toggler, .menu-toggle, #menuToggle {
        display: flex !important;
        padding: 8px !important;
    }
    
    .navbar-collapse, .nav-menu, .mobile-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: #fff;
        z-index: 9999;
        transition: left 0.3s ease;
        padding: 80px 20px 20px;
        overflow-y: auto;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
    
    .navbar-collapse.show, .nav-menu.active, .mobile-menu.active {
        left: 0;
    }
    
    .nav-link, .nav-item a {
        padding: 12px 0 !important;
        font-size: 0.95rem;
        border-bottom: 1px solid #f1f5f9;
        display: block !important;
    }
    
    /* Overlay */
    .menu-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
    }
    .menu-overlay.active {
        display: block;
    }
}

/* ========== 4. HERO SLIDER MOBIL ========== */
@media (max-width: 768px) {
    .hero-slider-wrapper, .hero-slider-section .row {
        flex-direction: column !important;
    }
    
    .hero-main-banner {
        min-height: 250px !important;
        max-height: 350px;
    }
    
    .hero-slide h2, .hero-slide-title {
        font-size: 1.5rem !important;
    }
    
    .hero-slide p {
        font-size: 0.85rem;
    }
    
    .hero-side-banners {
        width: 100% !important;
        flex-direction: row !important;
        display: flex !important;
        gap: 10px !important;
    }
    
    .side-banner {
        flex: 1;
        min-height: 120px;
    }
    
    .hero-arrow {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .hero-arrow-left { left: 8px; }
    .hero-arrow-right { right: 8px; }
}

/* ========== 5. POPULAR GAMES SLIDER MOBIL ========== */
@media (max-width: 768px) {
    .popular-games-section {
        padding: 20px 0;
    }
    
    .popular-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .popular-card {
        width: 160px;
    }
    
    .popular-card-img {
        width: 160px;
        height: 160px;
    }
    
    .popular-card-info h3 {
        font-size: 0.85rem;
    }
    
    .popular-card-info p {
        font-size: 0.75rem;
    }
}

/* ========== 6. CDKEY SECTION MOBIL ========== */
@media (max-width: 768px) {
    .cdkey-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .cdkey-card {
        padding: 12px;
    }
    
    .cdkey-card img {
        width: 40px;
        height: 40px;
    }
    
    .cdkey-card h3 {
        font-size: 0.8rem;
    }
}

/* ========== 7. NEDEN BIZ SECTION MOBIL ========== */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    .feature-card {
        flex-direction: row !important;
        text-align: left !important;
        padding: 16px;
    }
    
    .feature-icon {
        margin: 0 !important;
        width: 50px;
        height: 50px;
        flex-shrink: 0;
    }
}

/* ========== 8. FOOTER MOBIL ========== */
@media (max-width: 768px) {
    footer .row {
        flex-direction: column;
    }
    
    footer [class*="col-"] {
        margin-bottom: 24px;
    }
    
    footer h5 {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    footer a {
        font-size: 0.85rem;
        padding: 4px 0;
        display: block;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

/* ========== 9. CART MOBIL ========== */
@media (max-width: 768px) {
    .cart-layout {
        flex-direction: column !important;
    }
    
    .cart-items {
        width: 100% !important;
    }
    
    .cart-summary {
        width: 100% !important;
        position: static !important;
    }
    
    .cart-item {
        flex-direction: column;
        gap: 12px;
    }
    
    .cart-item-img {
        width: 100%;
        height: 150px;
    }
    
    .cart-item-info {
        width: 100%;
    }
    
    .cart-actions {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* ========== 10. CHECKOUT MOBIL ========== */
@media (max-width: 768px) {
    .checkout-layout {
        flex-direction: column !important;
    }
    
    .checkout-form, .checkout-summary {
        width: 100% !important;
    }
    
    .payment-methods {
        grid-template-columns: 1fr !important;
    }
    
    .payment-method {
        padding: 14px;
    }
}

/* ========== 11. GAME/PRODUCT PAGE MOBIL ========== */
@media (max-width: 768px) {
    .game-hero {
        flex-direction: column;
        padding: 16px;
    }
    
    .game-image {
        width: 100%;
        height: 200px;
    }
    
    .game-info {
        width: 100%;
    }
    
    .game-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .game-tab {
        white-space: nowrap;
        font-size: 0.8rem;
        padding: 8px 14px;
    }
    
    .epin-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    
    .epin-card {
        padding: 14px;
    }
}

/* ========== 12. MARKETPLACE MOBIL ========== */
@media (max-width: 768px) {
    .mp-layout {
        grid-template-columns: 1fr !important;
    }
    
    .mp-hero {
        min-height: 200px;
        padding: 20px;
    }
    
    .mp-filters {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .mp-filter-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    
    .mp-grid {
        grid-template-columns: 1fr !important;
    }
    
    .mp-card {
        flex-direction: column;
    }
    
    .mp-card-img {
        width: 100%;
        height: 180px;
    }
}

/* ========== 13. MESSAGES MOBIL ========== */
@media (max-width: 768px) {
    .msg-layout {
        flex-direction: column !important;
    }
    
    .msg-sidebar {
        width: 100% !important;
        max-height: 50vh;
        border-right: none !important;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .msg-chat {
        width: 100% !important;
        min-height: 50vh;
    }
    
    .conv-item {
        padding: 12px;
    }
    
    .conv-avatar {
        width: 40px;
        height: 40px;
    }
    
    .msg-bubble {
        max-width: 85%;
        font-size: 0.9rem;
    }
    
    .msg-input-area {
        padding: 10px;
    }
    
    .msg-input-area input {
        font-size: 16px; /* iOS zoom ongelmek icin */
    }
}

/* ========== 14. PROFILE MOBIL ========== */
@media (max-width: 768px) {
    .profile-layout {
        flex-direction: column;
    }
    
    .profile-sidebar {
        width: 100% !important;
    }
    
    .profile-cover {
        height: 150px;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
        margin-top: -40px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        width: 100%;
    }
}

/* ========== 15. ADMIN PANEL MOBIL ========== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        width: 260px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .content-wrapper {
        margin-left: 0 !important;
        padding: 15px;
    }
    
    .sidebar-toggle {
        display: flex !important;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-card h3 {
        font-size: 1.2rem;
    }
}

/* ========== 16. OPERATOR PANEL MOBIL ========== */
@media (max-width: 768px) {
    .operator-layout {
        flex-direction: column;
    }
    
    .operator-sidebar {
        width: 100%;
        max-height: 35vh;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .operator-main {
        width: 100%;
    }
    
    .chat-messages {
        min-height: 40vh;
    }
    
    .chat-input {
        padding: 10px;
    }
    
    .chat-input input {
        font-size: 16px;
    }
}

/* ========== 17. BUTTONS & FORMS MOBIL ========== */
@media (max-width: 768px) {
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 12px 24px;
    }
    
    .form-control, .form-input {
        font-size: 16px; /* iOS zoom engelleme */
        padding: 12px;
    }
    
    select.form-control, select.form-input {
        font-size: 16px;
    }
    
    .modal-content {
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ========== 18. TABLE MOBIL ========== */
@media (max-width: 768px) {
    .table-responsive {
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 600px;
    }
    
    .table th, .table td {
        padding: 10px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
}

/* ========== 19. MODAL MOBIL ========== */
@media (max-width: 768px) {
    .modal {
        padding: 0;
    }
    
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-content {
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-footer {
        padding: 12px 16px;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* ========== 20. NOTIFICATION TOAST MOBIL ========== */
@media (max-width: 768px) {
    .toast, .notification-toast {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
}

/* ========== 21. FAQ MOBIL ========== */
@media (max-width: 768px) {
    .faq-item {
        padding: 12px;
    }
    
    .faq-question {
        font-size: 0.9rem;
    }
    
    .faq-answer {
        font-size: 0.85rem;
    }
}

/* ========== 22. TICKET/DESTEK MOBIL ========== */
@media (max-width: 768px) {
    .ticket-layout {
        flex-direction: column;
    }
    
    .ticket-list {
        width: 100%;
        max-height: 40vh;
    }
    
    .ticket-detail {
        width: 100%;
    }
}

/* ========== 23. REFERANS/LINK MOBIL ========== */
@media (max-width: 768px) {
    .referral-link-box {
        flex-direction: column;
    }
    
    .referral-link-input {
        width: 100%;
    }
    
    .referral-stats {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ========== 24. GUVENLIK/VERIFICATION MOBIL ========== */
@media (max-width: 768px) {
    .verify-layout {
        flex-direction: column;
    }
    
    .verify-steps {
        width: 100%;
    }
    
    .verify-form {
        width: 100%;
    }
}

/* ========== 25. CATEGORI GRID MOBIL ========== */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    
    .category-card {
        padding: 12px;
    }
    
    .category-card img {
        width: 45px;
        height: 45px;
    }
    
    .category-card h3 {
        font-size: 0.85rem;
    }
}

/* ========== 26. SWIPE/HORIZONTAL SCROLL ========== */
@media (max-width: 768px) {
    .horizontal-scroll {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        padding: 10px 0;
        scrollbar-width: none;
    }
    
    .horizontal-scroll::-webkit-scrollbar {
        display: none;
    }
    
    .horizontal-scroll > * {
        scroll-snap-align: start;
        flex-shrink: 0;
    }
}

/* ========== 27. FAB (FLOATING ACTION BUTTON) ========== */
@media (max-width: 768px) {
    .fab {
        position: fixed;
        bottom: 24px;
        right: 24px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.4rem;
        z-index: 100;
        box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    }
}

/* ========== 28. SAFE AREA (iPhone notch) ========== */
@supports (padding: max(0px)) {
    .navbar, .nav, ._mn {
        padding-top: max(12px, env(safe-area-inset-top));
    }
    
    footer, .footer {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

/* ========== 29. DARK MODE DESTEGI ========== */
@media (prefers-color-scheme: dark) {
    .auto-dark {
        background: #0f172a;
        color: #e2e8f0;
    }
}

/* ========== 30. YAZI BOYUTU & OKUNABILIRLIK ========== */
@media (max-width: 768px) {
    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.3rem !important; }
    h3 { font-size: 1.1rem !important; }
    h4 { font-size: 1rem !important; }
    h5 { font-size: 0.9rem !important; }
    h6 { font-size: 0.85rem !important; }
    
    p, span, div, td, th {
        line-height: 1.5;
    }
    
    .text-responsive-sm { font-size: 0.8rem; }
    .text-responsive-md { font-size: 0.9rem; }
}

/* ========== 31. ANIMASYON & TRANSITION ========== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 32. PRINT ========== */
@media print {
    .navbar, .nav, footer, .fab, .chat-widget, .btn {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: #000;
    }
}
