/* Mobile Responsive CSS for Matrimonial Portal */
/* This file provides additional mobile responsive styles */

/* ============================================
   GENERAL MOBILE STYLES
   ============================================ */

/* Ensure body is scrollable and prevents horizontal overflow */
body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Container padding adjustments */
@media (max-width: 992px) {
    .container,
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* ============================================
   DATATABLES MOBILE RESPONSIVE
   ============================================ */

/* DataTables wrapper should scroll horizontally on mobile */
.dataTables_wrapper {
    width: 100%;
}

@media (max-width: 992px) {
    .dataTables_wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Compact DataTables controls */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        margin-bottom: 10px;
    }
    
    .dataTables_wrapper .dataTables_length select,
    .dataTables_wrapper .dataTables_filter input {
        width: auto;
        max-width: 150px;
    }
    
    /* Stack DataTables info and pagination on mobile */
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: center;
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    /* Even more compact on tablets */
    table.dataTable {
        font-size: 0.8rem;
    }
    
    table.dataTable thead th,
    table.dataTable tbody td {
        padding: 6px 4px;
    }
    
    /* Smaller pagination buttons */
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 0.3rem 0.5rem;
        margin: 0 2px;
    }
}

@media (max-width: 576px) {
    /* Tiny screens - most compact */
    table.dataTable {
        font-size: 0.7rem;
    }
    
    table.dataTable thead th,
    table.dataTable tbody td {
        padding: 4px 2px;
    }
}

/* ============================================
   FORMS MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    /* Stack form groups */
    .form-group,
    .mb-3 {
        margin-bottom: 1rem;
    }
    
    /* Full width form controls */
    .form-control,
    .form-select,
    select.form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Stack form buttons */
    .form-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .form-buttons .btn {
        width: 100%;
    }
}

/* ============================================
   CARDS MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 992px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .card-body {
        padding: 0.75rem;
    }
    
    .card-header {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   BUTTONS MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    /* Stack button groups on mobile */
    .btn-group-vertical {
        width: 100%;
    }
    
    .btn-group-vertical .btn {
        width: 100%;
        border-radius: 0.25rem !important;
        margin-bottom: 5px;
    }
    
    /* Dropdown buttons full width */
    .dropdown-menu {
        width: 100%;
    }
}

@media (max-width: 576px) {
    /* Smaller button text on tiny screens */
    .btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
    }
    
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* ============================================
   TABLES MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    /* Make tables scrollable */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Compact table styling */
    .table {
        font-size: 0.85rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* ============================================
   MODALS MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
}

/* ============================================
   NAVIGATION MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 992px) {
    /* Mobile navbar adjustments */
    .navbar-collapse {
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .navbar-nav {
        padding: 10px 0;
    }
    
    .navbar-nav .nav-item {
        margin: 5px 0;
    }
    
    /* Dropdown in navbar */
    .navbar .dropdown-menu {
        border: none;
        background: rgba(255, 255, 255, 0.1);
    }
}

/* ============================================
   PROFILE CARDS MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 992px) {
    /* Stack profile cards */
    .profile-card {
        margin-bottom: 1rem;
    }
    
    .profile-image {
        max-width: 150px;
        margin: 0 auto;
    }
}

@media (max-width: 576px) {
    .profile-image {
        max-width: 120px;
    }
}

/* ============================================
   DASHBOARD STATS CARDS
   ============================================ */

@media (max-width: 992px) {
    .stats-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    /* Stack all stat cards */
    .stats-row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }
}

/* ============================================
   SEARCH FILTERS MOBILE
   ============================================ */

@media (max-width: 768px) {
    .search-filters {
        padding: 1rem;
    }
    
    .search-filters .row {
        margin-left: 0;
        margin-right: 0;
    }
    
    .search-filters [class*="col-"] {
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 10px;
    }
}

/* ============================================
   BADGES & LABELS MOBILE
   ============================================ */

@media (max-width: 576px) {
    .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

/* ============================================
   SELECT2 MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .select2-container {
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    .select2-container .select2-selection--single {
        height: auto;
        min-height: 38px;
    }
}

/* ============================================
   UTILITY CLASSES FOR MOBILE
   ============================================ */

/* Hide on mobile */
@media (max-width: 576px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .hide-tablet {
        display: none !important;
    }
}

/* Show only on mobile */
.show-mobile {
    display: none !important;
}

@media (max-width: 576px) {
    .show-mobile {
        display: block !important;
    }
}

/* Text size adjustments for mobile */
@media (max-width: 768px) {
    .mobile-text-sm {
        font-size: 0.875rem !important;
    }
    
    .mobile-text-xs {
        font-size: 0.75rem !important;
    }
}

/* Spacing adjustments for mobile */
@media (max-width: 768px) {
    .mobile-p-2 {
        padding: 0.5rem !important;
    }
    
    .mobile-m-2 {
        margin: 0.5rem !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    /* Hide navigation and non-essential elements */
    .navbar,
    .sidebar,
    .top-navbar,
    .sidebar-toggle,
    .sidebar-overlay,
    footer,
    .no-print,
    .btn,
    button {
        display: none !important;
    }
    
    /* Reset main content margins */
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Full width for print */
    .container,
    .container-fluid {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    /* Remove shadows and backgrounds */
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Larger touch targets on mobile */
@media (max-width: 768px) {
    .btn,
    .nav-link,
    .dropdown-item,
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #e91e63;
    outline-offset: 2px;
}

/* ============================================
   SMOOTH SCROLLING
   ============================================ */

html {
    scroll-behavior: smooth;
}

/* ============================================
   LOADING STATES
   ============================================ */

@media (max-width: 768px) {
    /* Skeleton loading on mobile */
    .skeleton {
        animation: skeleton-loading 1s linear infinite alternate;
    }
    
    @keyframes skeleton-loading {
        0% {
            background-color: hsl(200, 20%, 80%);
        }
        100% {
            background-color: hsl(200, 20%, 95%);
        }
    }
}
