/* Mobile Responsive Improvements */

/* Global mobile viewport fixes */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Responsive table improvements */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
        min-width: 80px;
    }
    
    .table-responsive .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .btn-group .btn {
        flex: 1;
    }
    
    /* Hide less important columns on mobile */
    .table-responsive th:nth-child(1),
    .table-responsive td:nth-child(1) {
        display: none; /* Hide ID column */
    }
    
    /* Make action buttons stack vertically on very small screens */
    @media (max-width: 576px) {
        .btn-group {
            flex-direction: column;
        }
        
        .btn-group .btn {
            border-radius: 0.375rem !important;
            margin-bottom: 0.25rem;
        }
    }
}

/* Card improvements for mobile */
@media (max-width: 576px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .card-text {
        font-size: 0.875rem;
    }
}

/* Form improvements for mobile */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-group .btn {
        width: auto;
    }
}

/* Shift calendar mobile improvements */
@media (max-width: 768px) {
    .shift-calendar {
        padding: 0.5rem;
    }
    
    .shift-card {
        margin-bottom: 1rem;
        padding: 0.75rem;
        border: 1px solid #ddd;
        border-radius: 0.5rem;
    }
    
    .shift-header {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 0.5rem;
    }
    
    .shift-time {
        margin-top: 0.25rem;
        font-size: 0.875rem;
        color: #666;
    }
    
    .shifts-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .shift-details {
        margin-top: 0.5rem;
    }
    
    .shift-area {
        font-size: 0.875rem;
        color: #666;
        margin-bottom: 0.5rem;
    }
    
    .shift-capacity {
        margin-bottom: 0.5rem;
    }
    
    .capacity-bar {
        height: 6px;
        background-color: #e9ecef;
        border-radius: 3px;
        overflow: hidden;
        margin-top: 0.25rem;
    }
    
    .capacity-fill {
        height: 100%;
        background-color: #28a745;
        transition: width 0.3s ease;
    }
    
    .shift-description {
        font-size: 0.875rem;
        color: #666;
        margin-bottom: 0.5rem;
    }
    
    .shift-requirements {
        font-size: 0.875rem;
        color: #dc3545;
        margin-bottom: 0.5rem;
    }
    
    .shift-status {
        margin-top: 0.5rem;
    }
    
    .day-header {
        font-size: 1.125rem;
        font-weight: 600;
        color: #495057;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid #e9ecef;
    }
    
    .day-group {
        margin-bottom: 2rem;
    }
}

/* Navigation improvements for mobile */
@media (max-width: 640px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .nav-section-header {
        font-size: 0.7rem;
    }
}

/* Hero section mobile improvements */
@media (max-width: 768px) {
    .bg-gradient-primary {
        padding: 2rem 0 !important;
    }
    
    .display-4 {
        font-size: 1.75rem !important;
    }
    
    .lead {
        font-size: 1rem !important;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .d-flex.flex-column.flex-sm-row.gap-2 {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .d-flex.flex-column.flex-sm-row.gap-2 .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .display-4 {
        font-size: 1.5rem !important;
    }
    
    .lead {
        font-size: 0.9rem !important;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Modal improvements for mobile */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
    }
}

/* Statistics dashboard mobile improvements */
@media (max-width: 576px) {
    .statistics-card {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .statistics-card .card-title {
        font-size: 1.5rem;
    }
    
    .statistics-card .card-text {
        font-size: 0.875rem;
    }
}

/* Button improvements for mobile */
@media (max-width: 768px) {
    .btn-group-vertical {
        width: 100%;
    }
    
    .btn-group-vertical .btn {
        margin-bottom: 0.25rem;
    }
    
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}

/* Utility classes for mobile */
.mobile-hidden {
    display: none !important;
}

@media (min-width: 769px) {
    .mobile-hidden {
        display: block !important;
    }
}

.mobile-only {
    display: block !important;
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}

/* Text size adjustments for mobile */
@media (max-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.125rem;
    }
    
    h4 {
        font-size: 1rem;
    }
    
    h5 {
        font-size: 0.875rem;
    }
    
    h6 {
        font-size: 0.75rem;
    }
}

/* Spacing adjustments for mobile */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .col-lg-3,
    .col-lg-4,
    .col-lg-6,
    .col-lg-8,
    .col-lg-12,
    .col-md-3,
    .col-md-4,
    .col-md-6,
    .col-md-8,
    .col-md-12,
    .col-sm-6,
    .col-sm-12 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}
