/* ===== MOBILE OPTIMIZATIONS ===== */

/* Mobile-first responsive utilities */
.mobile-stack {
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .mobile-stack {
        flex-direction: row;
    }
}

/* Touch-friendly buttons */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
    }
    
    .btn-sm {
        min-height: 40px;
        padding: 8px 12px;
    }
    
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 12px 16px;
    }
}

/* Mobile table optimizations */
@media (max-width: 768px) {
    .table-responsive {
        border: none;
        box-shadow: none;
    }
    
    .table {
        font-size: 0.85rem;
        margin-bottom: 0;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        vertical-align: middle;
    }
    
    .table th:first-child,
    .table td:first-child {
        padding-left: 0.5rem;
    }
    
    .table th:last-child,
    .table td:last-child {
        padding-right: 0.5rem;
    }
}

/* Mobile card optimizations */
@media (max-width: 576px) {
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
}

/* Mobile form optimizations */
@media (max-width: 768px) {
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 16px;
    }
    
    .form-label {
        font-weight: 600;
        margin-bottom: 0.5rem;
    }
    
    .form-text {
        font-size: 0.8rem;
    }
}

/* Mobile badge optimizations */
@media (max-width: 576px) {
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        border-radius: 0.25rem;
    }
    
    .badge-lg {
        font-size: 0.8rem;
        padding: 0.4rem 0.7rem;
    }
}

/* Mobile icon optimizations */
@media (max-width: 768px) {
    .fa-2x {
        font-size: 1.5em !important;
    }
    
    .fa-3x {
        font-size: 2em !important;
    }
    
    .fa-4x {
        font-size: 2.5em !important;
    }
}

/* Mobile spacing optimizations */
@media (max-width: 576px) {
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    .mb-3 {
        margin-bottom: 1rem !important;
    }
    
    .py-4 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* Mobile text optimizations */
@media (max-width: 768px) {
    .display-1 { font-size: 2.5rem; }
    .display-2 { font-size: 2rem; }
    .display-3 { font-size: 1.75rem; }
    .display-4 { font-size: 1.5rem; }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.2rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.9rem; }
}

/* Mobile navigation optimizations */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
}

/* Mobile dashboard optimizations */
@media (max-width: 768px) {
    .stats-number {
        font-size: 1.5rem;
        font-weight: bold;
    }
    
    .stats-label {
        font-size: 0.8rem;
    }
    
    .page-header {
        padding: 1.5rem 0;
        text-align: center;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .page-header p {
        font-size: 0.9rem;
        margin-bottom: 0;
    }
}

/* Mobile button groups */
@media (max-width: 576px) {
    .btn-group-vertical .btn {
        margin-bottom: 0.25rem;
        border-radius: 0.375rem !important;
    }
    
    .btn-group-vertical .btn:first-child {
        border-top-left-radius: 0.375rem !important;
        border-top-right-radius: 0.375rem !important;
    }
    
    .btn-group-vertical .btn:last-child {
        border-bottom-left-radius: 0.375rem !important;
        border-bottom-right-radius: 0.375rem !important;
    }
}

/* Mobile modal optimizations */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
    }
}

/* Mobile alert optimizations */
@media (max-width: 576px) {
    .alert {
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }
    
    .alert-dismissible .btn-close {
        padding: 0.75rem 1rem;
    }
}

/* Mobile pagination optimizations */
@media (max-width: 576px) {
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* Mobile list optimizations */
@media (max-width: 768px) {
    .list-group-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .list-group-item:first-child {
        border-top-left-radius: 0.5rem;
        border-top-right-radius: 0.5rem;
    }
    
    .list-group-item:last-child {
        border-bottom-left-radius: 0.5rem;
        border-bottom-right-radius: 0.5rem;
    }
}

/* Mobile utility classes */
.mobile-center {
    text-align: center;
}

@media (min-width: 768px) {
    .mobile-center {
        text-align: left;
    }
}

.mobile-full-width {
    width: 100%;
}

@media (min-width: 768px) {
    .mobile-full-width {
        width: auto;
    }
}

.mobile-hide {
    display: none;
}

@media (min-width: 768px) {
    .mobile-hide {
        display: block;
    }
}

.mobile-show {
    display: block;
}

@media (min-width: 768px) {
    .mobile-show {
        display: none;
    }
}
