/* Additional Mobile-Specific Styles */

/* Prevent text selection on buttons and interactive elements */
.btn,
.nav-link,
.mobile-menu-toggle,
.mobile-menu-close {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

/* Better scrolling on mobile */
.content-wrapper,
.product-list,
.cart-items,
.table-responsive {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Fix iOS input zoom issue */
@media screen and (max-width: 767px) {
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}

/* Better modal on mobile */
@media (max-width: 767.98px) {
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }
    
    .modal-content {
        height: 100%;
        border-radius: 0;
        border: none;
    }
    
    .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Fix DataTables on mobile */
@media (max-width: 767.98px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        margin-bottom: 0.5rem;
    }
    
    .dataTables_wrapper .dataTables_length select,
    .dataTables_wrapper .dataTables_filter input {
        min-height: 44px;
        font-size: 16px; /* Prevent zoom */
    }
    
    .dataTables_wrapper .dataTables_paginate {
        margin-top: 0.5rem;
    }
    
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        min-height: 44px;
        min-width: 44px;
        padding: 0.5rem;
    }
}

/* Better form layouts on mobile */
@media (max-width: 767.98px) {
    .form-row,
    .row {
        margin-left: 0;
        margin-right: 0;
    }
    
    .form-row > [class*="col-"],
    .row > [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .input-group {
        flex-wrap: wrap;
    }
    
    .input-group .form-control {
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* Better card layouts */
@media (max-width: 767.98px) {
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .card-header {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .card-footer {
        padding: 0.75rem;
    }
}

/* Better button groups on mobile */
@media (max-width: 767.98px) {
    .btn-group-vertical {
        width: 100%;
    }
    
    .btn-group-vertical .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-toolbar {
        flex-direction: column;
    }
    
    .btn-toolbar .btn-group {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Better alerts on mobile */
@media (max-width: 767.98px) {
    .alert {
        padding: 0.75rem;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    .alert-dismissible .btn-close {
        padding: 0.75rem;
    }
}

/* Better badges and labels */
@media (max-width: 767.98px) {
    .badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
    }
}

/* Loading states */
.mobile-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    z-index: 9999;
    animation: loading 1s infinite;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* PWA Install Banner (optional) */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--navbar-bg);
    color: white;
    padding: 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pwa-install-banner.show {
    display: flex;
}

.pwa-install-banner .banner-content {
    flex: 1;
}

.pwa-install-banner .banner-content h6 {
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
}

.pwa-install-banner .banner-content p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.pwa-install-banner .banner-actions {
    display: flex;
    gap: 0.5rem;
}

.pwa-install-banner .btn {
    white-space: nowrap;
    min-width: 80px;
}

/* Landscape orientation fixes */
@media (max-width: 991.98px) and (orientation: landscape) {
    .navbar-container {
        padding: 0.4rem 1rem;
    }
    
    .content-wrapper {
        padding: 0.75rem;
    }
    
    .mobile-menu-sidebar {
        width: 250px;
    }
}

/* Dashboard mobile optimizations */
@media (max-width: 767.98px) {
    .row .col-md-3 {
        margin-bottom: 1rem;
    }
    
    .card .card-body h3 {
        font-size: 1.5rem;
    }
    
    .card .card-body h5 {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }
    
    /* Chart containers */
    .chart-container {
        height: 250px !important;
        margin-bottom: 1rem;
    }
}

/* Print styles (hide mobile menu on print) */
@media print {
    .top-navbar,
    .mobile-menu-toggle,
    .mobile-menu-overlay,
    .mobile-menu-sidebar {
        display: none !important;
    }
    
    .content-wrapper {
        padding: 0;
    }
}

/* Reports Page Mobile Styles */
.reports-page-container {
    padding: 0.5rem;
    height: auto;
    min-height: 100%;
    display: block;
    overflow: visible;
    width: 100%;
}

/* Reports page container scrollbar stilleri (mobilde de görünsün) */
.reports-page-container::-webkit-scrollbar {
    width: 10px;
}

.reports-page-container::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
}

.reports-page-container::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.reports-page-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Firefox için scrollbar */
.reports-page-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.8) rgba(102, 126, 234, 0.1);
}

.reports-page-container h3 {
    flex: 0 0 auto;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.reports-card {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
    overflow: visible;
}

.reports-card-header {
    flex: 0 0 auto;
    padding: 0.5rem 0.75rem;
}

.reports-card-header h5 {
    font-size: 1rem;
    margin: 0;
}

.reports-card-body {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    overflow: visible;
}

.reports-button-row {
    flex: 0 0 auto;
    margin-bottom: 0.5rem;
}

.reports-button-row .reports-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    min-height: 44px;
}

.reports-date-row {
    flex: 0 0 auto;
    margin-bottom: 0.5rem;
}

.reports-date-row .form-label {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.reports-date-row .form-control {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    min-height: 44px;
}

.reports-summary {
    flex: 0 0 auto;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.reports-summary h5 {
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

.reports-summary p {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.reports-charts-row {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    overflow: visible;
    -webkit-overflow-scrolling: touch;
}

.reports-chart-container {
    height: 300px;
    position: relative;
    min-height: 250px;
    width: 100%;
}

.reports-chart-container canvas {
    position: relative;
    z-index: 10;
}

.reports-chart-no-data {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 5px;
}

.reports-table-responsive {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: auto !important;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.reports-table-responsive table {
    font-size: 0.875rem;
    margin-bottom: 0;
}

.reports-table-responsive th,
.reports-table-responsive td {
    padding: 0.5rem;
    font-size: 0.875rem;
}

@media (max-width: 767.98px) {
    .reports-page-container {
        padding: 0.25rem;
        overflow: visible;
        height: auto;
        min-height: 100%;
        width: 100%;
    }
    
    /* Mobilde content-wrapper scrollbar'ı kullan */
    body.reports-page .content-wrapper {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .reports-page-container h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    /* Tab Navigation - Mobil için scroll edilebilir */
    .reports-tabs {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        white-space: nowrap;
        margin-bottom: 0.75rem;
        display: flex;
        -ms-overflow-style: none; /* IE and Edge */
        scrollbar-width: none; /* Firefox */
    }
    
    .reports-tabs::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    
    .reports-tabs .nav-item {
        flex-shrink: 0;
    }
    
    .reports-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        white-space: nowrap;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .reports-button-row .col-6 {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    
    .reports-charts-row {
        flex-direction: column;
    }
    
    .reports-charts-row .col-12 {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .reports-chart-container {
        height: 280px;
        min-height: 250px;
        width: 100%;
    }
    
    .reports-card-body {
        padding: 0.75rem;
    }
    
    .reports-table-responsive {
        font-size: 0.8rem;
        max-height: none;
    }
    
    .reports-table-responsive th,
    .reports-table-responsive td {
        padding: 0.4rem 0.3rem;
        font-size: 0.8rem;
    }
    
    .reports-summary {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .reports-summary h5 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .reports-summary p {
        font-size: 0.8rem;
        margin-bottom: 0.25rem;
    }
    
    /* Checkbox'lar mobilde daha büyük */
    .reports-card-body .form-check {
        margin-bottom: 0.5rem;
    }
    
    .reports-card-body .form-check-label {
        font-size: 0.875rem;
        padding-left: 0.5rem;
    }
    
    .reports-card-body .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
        margin-top: 0.125rem;
    }
    
    /* Export butonları mobilde tam genişlik */
    .reports-card-body .d-flex.gap-2 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .reports-card-body .d-flex.gap-2 .btn {
        width: 100%;
        min-height: 44px;
    }
}

/* List Page Mobile Styles */
.list-page-container {
    padding: 0.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.list-page-container h3 {
    flex: 0 0 auto;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.list-page-actions {
    flex: 0 0 auto;
    margin-bottom: 0.5rem;
}

.list-page-actions .btn {
    min-height: 44px;
}

.list-page-filters {
    flex: 0 0 auto;
    margin-bottom: 0.5rem;
}

.list-page-filters .form-select {
    min-height: 44px;
    font-size: 16px; /* Prevent iOS zoom */
}

.list-page-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    margin-bottom: 0;
}

.list-page-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 0.5rem;
}

.list-page-table-responsive {
    flex: 1;
    overflow-x: auto !important;
    overflow-y: auto !important;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {
    .list-page-container {
        padding: 0.25rem;
    }
    
    .list-page-container h3 {
        font-size: 1.1rem;
    }
    
    .list-page-card-body {
        padding: 0.5rem;
    }
    
    .list-page-table-responsive {
        font-size: 0.85rem;
    }
    
    /* DataTables responsive adjustments */
    .list-page-table-responsive .dataTables_wrapper {
        font-size: 0.85rem;
    }
    
    .list-page-table-responsive .dataTables_wrapper .dataTables_length,
    .list-page-table-responsive .dataTables_wrapper .dataTables_filter {
        margin-bottom: 0.5rem;
    }
    
    .list-page-table-responsive .dataTables_wrapper .dataTables_length select,
    .list-page-table-responsive .dataTables_wrapper .dataTables_filter input {
        min-height: 44px;
        font-size: 16px; /* Prevent iOS zoom */
        padding: 0.5rem;
    }
    
    .list-page-table-responsive .dataTables_wrapper .dataTables_paginate {
        margin-top: 0.5rem;
    }
    
    .list-page-table-responsive .dataTables_wrapper .dataTables_paginate .paginate_button {
        min-height: 44px;
        min-width: 44px;
        padding: 0.5rem;
        margin: 0.25rem;
    }
    
    .list-page-table-responsive table {
        font-size: 0.8rem;
    }
    
    .list-page-table-responsive th,
    .list-page-table-responsive td {
        padding: 0.4rem 0.3rem;
        font-size: 0.8rem;
    }
}

