/* Mobile-Specific CSS Fixes for SagunBapla */

/* Ensure proper mobile viewport handling */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Fix for iOS Safari */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Mobile Navigation Fixes */
.navbar-toggler {
    border: none;
    padding: 4px 8px;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-collapse {
    background: rgba(0, 123, 255, 0.95);
    border-radius: 10px;
    margin-top: 10px;
    padding: 15px;
}

/* Mobile Form Fixes */
.form-control {
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 8px;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Mobile Button Fixes */
.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 12px 20px;
    min-height: 44px; /* iOS touch target minimum */
}

.btn-lg {
    padding: 15px 25px;
    font-size: 1.1rem;
}

/* Mobile Card Fixes */
.card {
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-body {
    padding: 20px;
}

/* Mobile Profile Card Fixes */
.profile-card {
    margin-bottom: 20px;
}

.profile-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
}

/* Mobile Dashboard Fixes */
.dashboard-stats {
    margin-bottom: 20px;
    padding: 20px;
}

.stat-card {
    padding: 15px;
    margin-bottom: 15px;
}

.stat-number {
    font-size: 2rem;
}

/* Mobile Message Fixes */
.message-container {
    height: 300px;
    border-radius: 12px;
}

.message {
    max-width: 85%;
    word-wrap: break-word;
}

/* Mobile Photo Gallery Fixes */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.photo-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile Modal Fixes */
.modal-dialog {
    margin: 10px;
    max-width: calc(100% - 20px);
}

.modal-content {
    border-radius: 12px;
}

.modal-body {
    padding: 20px;
}

/* Mobile Table Fixes */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table th,
.table td {
    padding: 12px 8px;
    font-size: 0.9rem;
}

/* Mobile Alert Fixes */
.alert {
    border-radius: 8px;
    margin: 15px 0;
    padding: 15px;
}

/* Mobile Hero Section Fixes */
.hero-section {
    padding: 60px 15px;
    text-align: center;
}

.hero-section h1 {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* Mobile Admin Panel Fixes */
.admin-card {
    margin-bottom: 20px;
}

.quick-action-btn {
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    display: block;
}

/* Mobile Input Group Fixes */
.input-group {
    margin-bottom: 15px;
}

.input-group-text {
    border-radius: 8px 0 0 8px;
}

.input-group .form-control {
    border-radius: 0 8px 8px 0;
}

/* Mobile Spacing Fixes */
.mb-mobile {
    margin-bottom: 15px;
}

.mt-mobile {
    margin-top: 15px;
}

.p-mobile {
    padding: 15px;
}

/* Mobile Text Fixes */
.text-mobile-center {
    text-align: center;
}

.text-mobile-left {
    text-align: left;
}

/* Mobile Flex Fixes */
.d-flex-mobile-column {
    flex-direction: column;
}

.d-flex-mobile-row {
    flex-direction: row;
}

/* Mobile Grid Fixes */
.row-mobile {
    margin: 0 -10px;
}

.col-mobile {
    padding: 0 10px;
    margin-bottom: 15px;
}

/* Mobile Touch Fixes */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Loading Fixes */
.loading {
    width: 30px;
    height: 30px;
    border-width: 3px;
}

/* Mobile Scroll Fixes */
.mobile-scroll {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

/* Mobile Image Fixes */
img {
    max-width: 100%;
    height: auto;
}

/* Mobile Video Fixes */
video {
    max-width: 100%;
    height: auto;
}

/* Mobile Print Fixes */
@media print {
    .navbar,
    .btn,
    .modal {
        display: none !important;
    }
}

/* Mobile Landscape Fixes */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 40px 15px;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .modal-dialog {
        margin: 5px;
    }
}

/* Mobile Portrait Fixes */
@media (max-width: 768px) and (orientation: portrait) {
    .profile-image {
        height: 250px;
    }
    
    .message-container {
        height: 250px;
    }
}

/* Mobile Very Small Screens */
@media (max-width: 360px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 15px;
    }
}

/* Mobile Accessibility Fixes */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #2d3748;
        color: #e2e8f0;
    }
    
    .form-control {
        background-color: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .form-control:focus {
        background-color: #4a5568;
        border-color: #007bff;
        color: #e2e8f0;
    }
}
