/* Mobile Responsive Styles for LAPSITDA */

/* Extra Small Devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    /* Layout */
    .page-content {
        padding: 0.5rem;
    }
    
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    /* Cards */
    .card {
        margin-bottom: 0.75rem;
    }
    
    .card-header {
        padding: 0.5rem 0.75rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .card-header h4 {
        font-size: 1.1rem;
    }
    
    /* Buttons */
    .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .btn-sm {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .btn-group .btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Forms */
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.5rem 0.75rem;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .form-text {
        font-size: 0.75rem;
    }
    
    /* Tables */
    .table th,
    .table td {
        padding: 0.25rem 0.1rem;
        font-size: 0.7rem;
    }
    
    /* Pagination */
    .pagination .page-link {
        padding: 0.25rem 0.4rem;
        font-size: 0.7rem;
    }
    
    /* Alerts */
    .alert {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    
    /* Badges */
    .badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Topbar */
    .topbar {
        padding: 0.5rem 0.75rem;
    }
    
    .topbar-title {
        font-size: 1rem;
    }
    
    /* Sidebar */
    .sidebar {
        width: 260px;
    }
    
    /* Statistics Cards */
    .stats-card .card-body {
        padding: 1rem 0.75rem;
    }
    
    .stats-card .card-title {
        font-size: 0.9rem;
    }
    
    .stats-card h2 {
        font-size: 1.5rem;
    }
    
    .stats-card .fs-1 {
        font-size: 2rem !important;
    }
    
    /* Welcome Section */
    .card-body .fs-5 {
        font-size: 1rem !important;
    }
    
    .card-body h2 {
        font-size: 1.5rem;
    }
    
    /* Mobile Card View */
    .d-md-none .card {
        margin-bottom: 0.75rem;
    }
    
    .d-md-none .card-body {
        padding: 0.75rem;
    }
    
    .d-md-none .row {
        margin-bottom: 0.5rem;
    }
    
    .d-md-none .btn-group {
        gap: 0.25rem;
    }
    
    .d-md-none .btn-group .btn {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Layout */
    .page-content {
        padding: 0.75rem;
    }
    
    /* Cards */
    .card {
        margin-bottom: 1rem;
    }
    
    /* Buttons */
    .btn {
        font-size: 0.85rem;
        padding: 0.45rem 0.9rem;
    }
    
    /* Forms */
    .form-control {
        font-size: 16px;
    }
    
    /* Tables */
    .table th,
    .table td {
        padding: 0.4rem 0.2rem;
        font-size: 0.75rem;
    }
    
    /* Statistics Cards */
    .stats-card .card-body {
        padding: 1.25rem;
    }
    
    .stats-card .card-title {
        font-size: 1rem;
    }
    
    .stats-card h2 {
        font-size: 1.75rem;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Sidebar */
    .sidebar {
        width: 250px;
    }
    
    .main-content {
        margin-left: 250px;
    }
    
    /* Tables */
    .table th,
    .table td {
        padding: 0.6rem 0.3rem;
        font-size: 0.85rem;
    }
    
    /* Buttons */
    .btn {
        font-size: 0.9rem;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) {
    /* Sidebar */
    .sidebar {
        width: 280px;
    }
    
    .main-content {
        margin-left: 280px;
    }
}

/* Mobile Navigation Improvements */
@media (max-width: 768px) {
    /* Sidebar */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    /* Topbar */
    .topbar {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    .topbar-title {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    /* Mobile Navigation */
    .sidebar-nav .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .sidebar-user {
        padding: 1rem;
    }

    .user-name {
        font-size: 1rem;
    }

    .user-role {
        font-size: 0.8rem;
    }

    /* Mobile Cards */
    .card {
        margin-bottom: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Mobile Buttons */
    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .btn-sm {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }

    /* Mobile Forms */
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    /* Mobile Tables */
    .table-responsive {
        border-radius: 0.5rem;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Mobile Pagination */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
    }

    /* Mobile Alerts */
    .alert {
        font-size: 0.9rem;
        padding: 0.75rem;
    }

    /* Mobile Dropdown */
    .dropdown-menu {
        font-size: 0.9rem;
    }

    /* Mobile Badge */
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Filter Form Responsive */
@media (max-width: 768px) {
    .filter-form .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .filter-form .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .filter-form .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    .filter-form .input-group-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .filter-form .card-body {
        padding: 0.75rem;
    }
    
    .filter-form .form-control {
        font-size: 16px;
        padding: 0.5rem 0.75rem;
    }
    
    .filter-form .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--primary-color);
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(52, 73, 94, 0.1);
    color: var(--secondary-color);
}

/* Mobile Card View Improvements */
.d-md-none .card {
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.d-md-none .card-body .row {
    border-bottom: 1px solid #f8f9fa;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.d-md-none .card-body .row:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.d-md-none .btn-group {
    margin-top: 0.5rem;
}

.d-md-none .btn-group .btn {
    flex: 1;
    margin: 0 0.125rem;
}

/* Responsive Grid Improvements */
@media (max-width: 576px) {
    .col-12 {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

/* Touch-friendly improvements */
@media (max-width: 768px) {
    .btn {
        min-height: 44px; /* iOS touch target minimum */
    }
    
    .form-control {
        min-height: 44px;
    }
    
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}
