/* Mobile Responsive CSS for Sistem Magang STKIP */

/* ===== GENERAL MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  /* Container adjustments */
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  /* Typography adjustments */
  h1 {
    font-size: 1.5rem !important;
  }
  
  h2 {
    font-size: 1.3rem !important;
  }
  
  h3 {
    font-size: 1.1rem !important;
  }
  
  /* Card adjustments */
  .card {
    margin-bottom: 15px;
  }
  
  .card-body {
    padding: 15px;
  }
  
  /* Table responsive */
  .table-responsive {
    font-size: 0.85rem;
  }
  
  .table td, .table th {
    padding: 0.5rem;
  }
  
  /* Button adjustments */
  .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
  }
  
  .btn-sm {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
  }
  
  /* Form adjustments */
  .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  /* Modal adjustments */
  .modal-dialog {
    margin: 10px;
  }
  
  .modal-body {
    padding: 15px;
  }
}

/* ===== NAVBAR MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  .navbar-brand {
    font-size: 1rem;
  }
  
  .navbar-brand img {
    width: 30px;
    height: 30px;
  }
  
  .navbar-nav .nav-link {
    padding: 0.5rem 1rem;
  }
  
  .dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  }
}

/* ===== SIDEBAR MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  /* Let AdminLTE handle sidebar behavior natively */
  /* Only add styling improvements that don't interfere with AdminLTE */
  
  .sidebar {
    padding-top: 10px;
  }
  
  .nav-sidebar .nav-link {
    padding: 12px 15px;
    font-size: 0.9rem;
  }
  
  .nav-sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
  }
  
  /* Improve touch targets for mobile */
  .nav-sidebar .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* ===== DASHBOARD MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  /* Small boxes */
  .small-box {
    margin-bottom: 15px;
  }
  
  .small-box .inner {
    padding: 15px;
  }
  
  .small-box .inner h3 {
    font-size: 1.5rem;
  }
  
  .small-box .inner p {
    font-size: 0.9rem;
  }
  
  /* Info boxes */
  .info-box {
    margin-bottom: 15px;
  }
  
  .info-box .info-box-content {
    padding: 10px;
  }
  
  /* Content wrapper */
  .content-wrapper {
    margin-left: 0;
  }
  
  /* Breadcrumb */
  .breadcrumb {
    font-size: 0.8rem;
    padding: 0.5rem 0;
  }
}

/* ===== TABLE MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  /* Stack table on mobile */
  .table-responsive .table {
    display: block;
    width: 100%;
  }
  
  .table-responsive .table thead {
    display: none;
  }
  
  .table-responsive .table tbody,
  .table-responsive .table tr,
  .table-responsive .table td {
    display: block;
    width: 100%;
  }
  
  .table-responsive .table tr {
    border: 1px solid #dee2e6;
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
  }
  
  .table-responsive .table td {
    border: none;
    padding: 5px 0;
    text-align: left;
  }
  
  .table-responsive .table td:before {
    content: attr(data-label) ": ";
    font-weight: bold;
    display: inline-block;
    width: 40%;
  }
  
  /* Action buttons in table */
  .table-responsive .btn {
    margin: 2px;
    font-size: 0.75rem;
  }
}

/* ===== FORM MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  .form-group {
    margin-bottom: 15px;
  }
  
  .form-control {
    height: 40px;
  }
  
  .form-control-lg {
    height: 48px;
  }
  
  .form-control-sm {
    height: 32px;
  }
  
  /* Select2 mobile optimization */
  .select2-container {
    width: 100% !important;
  }
  
  .select2-container--default .select2-selection--single {
    height: 40px;
    line-height: 38px;
  }
  
  /* Datepicker mobile optimization */
  .datepicker {
    font-size: 14px;
  }
  
  .datepicker table tr td {
    padding: 8px;
  }
}

/* ===== MODAL MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  .modal-dialog {
    margin: 10px;
    max-width: calc(100% - 20px);
  }
  
  .modal-header {
    padding: 15px;
  }
  
  .modal-body {
    padding: 15px;
    max-height: 70vh;
    overflow-y: auto;
  }
  
  .modal-footer {
    padding: 15px;
    flex-direction: column;
  }
  
  .modal-footer .btn {
    margin: 5px 0;
    width: 100%;
  }
}

/* ===== CHART MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  .chart-container {
    height: 250px !important;
  }
  
  .chart-responsive {
    position: relative;
    height: 250px;
  }
}

/* ===== ALERT MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  .alert {
    padding: 10px 15px;
    margin-bottom: 15px;
  }
  
  .alert-dismissible .close {
    padding: 10px 15px;
  }
}

/* ===== BADGE MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
}

/* ===== PROGRESS BAR MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  .progress {
    height: 20px;
    margin-bottom: 10px;
  }
  
  .progress-sm {
    height: 15px;
  }
}

/* ===== CUSTOM MOBILE UTILITIES ===== */
@media (max-width: 768px) {
  /* Hide elements on mobile */
  .d-mobile-none {
    display: none !important;
  }
  
  /* Show elements only on mobile */
  .d-mobile-block {
    display: block !important;
  }
  
  /* Text alignment on mobile */
  .text-mobile-center {
    text-align: center !important;
  }
  
  .text-mobile-left {
    text-align: left !important;
  }
  
  /* Margin adjustments */
  .mb-mobile-2 {
    margin-bottom: 0.5rem !important;
  }
  
  .mb-mobile-3 {
    margin-bottom: 1rem !important;
  }
  
  /* Padding adjustments */
  .p-mobile-2 {
    padding: 0.5rem !important;
  }
  
  .p-mobile-3 {
    padding: 1rem !important;
  }
}

/* ===== LANDSCAPE ORIENTATION ===== */
@media (max-width: 768px) and (orientation: landscape) {
  .modal-dialog {
    margin: 5px;
  }
  
  .modal-body {
    max-height: 60vh;
  }
  
  .chart-container {
    height: 200px !important;
  }
}

/* ===== LARGE MOBILE DEVICES ===== */
@media (min-width: 576px) and (max-width: 768px) {
  .container {
    max-width: 540px;
  }
  
  .table-responsive .table td:before {
    width: 30%;
  }
}

/* ===== EXTRA SMALL DEVICES ===== */
@media (max-width: 575px) {
  .container {
    padding-left: 5px;
    padding-right: 5px;
  }
  
  .card-body {
    padding: 10px;
  }
  
  .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
  }
  
  .table-responsive .table td:before {
    width: 50%;
  }
  
  .modal-dialog {
    margin: 5px;
  }
}

/* ===== TOUCH OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  /* Larger touch targets */
  .btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  /* Better touch feedback */
  .btn:active,
  .nav-link:active {
    transform: scale(0.95);
  }
  
  /* Smooth scrolling */
  html {
    scroll-behavior: smooth;
  }
}

/* ===== PRINT OPTIMIZATIONS ===== */
@media print {
  .navbar,
  .sidebar,
  .main-footer,
  .btn,
  .modal {
    display: none !important;
  }
  
  .content-wrapper {
    margin-left: 0 !important;
  }
  
  .card {
    border: 1px solid #000 !important;
    box-shadow: none !important;
  }
}
