/* ============================================
   RESPONSIVE CSS - RCC Infrastructure
   ============================================ */

/* --- Global Responsive Fixes --- */
* {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Utility Classes (replacing inline styles) --- */
.text-red {
  color: red;
}

.text-white {
  color: #fff;
}

.text-capitalize {
  text-transform: capitalize;
}

.text-center {
  text-align: center;
}

.cursor-pointer {
  cursor: pointer;
}

.d-none {
  display: none;
}

.no-resize {
  resize: none;
}

.font-15 {
  font-size: 15px;
}

.font-20 {
  font-size: 20px;
}

.mb-0 {
  margin-bottom: 0px;
}

.mt-10 {
  margin-top: 10px;
}

.pt-3 {
  padding-top: 3%;
}

.pt-10 {
  padding-top: 10%;
}

/* --- Modal Header Themed --- */
.modal-header-themed {
  background-color: #76c62b;
  color: #fff;
}

.modal-header-themed span {
  font-size: 20px;
}

/* --- Button Styles --- */
.btn-success-n {
  background-color: #76c62b !important;
  color: #fff;
  border-color: #76c62b;
}

.btn-success-n:hover,
.btn-success-n:focus {
  background-color: #65ad24 !important;
  color: #fff;
  border-color: #65ad24;
}

/* --- Status Badge --- */
.status-badge {
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
}

/* --- Thumbnail Images --- */
.img-thumb-sm {
  height: 25px;
  width: 25px;
  object-fit: cover;
}

.img-thumb-md {
  height: 64px;
  width: 70px;
  object-fit: cover;
}

.img-thumb-lg {
  width: 100px;
  height: 100px;
  object-fit: cover;
}

/* --- Header/Navbar --- */
.main-header .navbar {
  min-height: 50px;
}

/* Sidebar Hamburger Toggle - Pure CSS */
.sidebar-hamburger {
  cursor: pointer;
  position: relative;
  font-size: 0 !important;
  color: transparent !important;
  width: 50px !important;
}

.sidebar-hamburger .logo-mini,
.sidebar-hamburger .logo-lg {
  display: none !important;
}

.sidebar-hamburger::before {
  content: '';
  position: absolute;
  top: 17px;
  left: 14px;
  width: 22px;
  height: 3px;
  background-color: #fff;
  border-radius: 2px;
  box-shadow: 0 7px 0 #fff, 0 14px 0 #fff;
}

.main-header .navbar-header {
  display: flex;
  align-items: center;
  float: left;
  max-width: calc(100% - 150px);
  overflow: hidden;
}

.main-header .navbar-brand {
  padding: 5px 15px;
  height: auto;
  float: none;
}

.header-logo-img {
  height: 45px;
  width: auto;
  max-width: 400px;
  object-fit: contain;
}

.header-welcome-text {
  display: inline-block;
  padding-left: 15px;
  margin-left: 15px;
  border-left: 2px solid #8c8c8c;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 350px;
  vertical-align: middle;
}

.navbar-custom-menu {
  float: right !important;
}

/* --- Sidebar Responsive --- */
.sidebar .user-panel .info h6 {
  margin: 2px 0;
}

/* --- Content Wrapper --- */
.content-wrapper {
  min-height: calc(100vh - 101px);
}

/* --- DataTable Responsive --- */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive > .table {
  margin-bottom: 0;
}

/* DataTables export button row (copy/csv/excel/pdf/print) wraps onto
   multiple lines instead of overflowing off narrow screens. */
.dt-buttons.btn-group {
  float: none !important;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.dt-buttons.btn-group .btn {
  border-radius: 4px !important;
}

/* --- Form Responsive --- */
.form-group label {
  word-wrap: break-word;
}

/* --- Salary Slip Table Styles --- */
.salary-slip-table {
  width: 100%;
  border-collapse: collapse;
}

.salary-slip-table td,
.salary-slip-table th {
  padding: 4px 8px;
  vertical-align: top;
}

.salary-slip-header {
  text-align: center;
  line-height: 1.5em;
}

.salary-slip-border-bottom {
  border-bottom: 1px solid black;
}

.salary-slip-border-top {
  border-top: 1px solid black;
}

.salary-slip-amount {
  text-align: right;
}

/* --- Login Page Responsive --- */
.login-box-size {
  height: auto;
  min-height: 730px;
}

.login-logo-img {
  width: 600px;
  max-width: 100%;
}

/* --- Download Sample Link --- */
.download-sample-link {
  font-size: 15px;
}

/* --- Error Message Spans --- */
.error-span {
  color: red;
  font-size: 12px;
}

/* --- Panel Fixes --- */
.panel-success > .panel-heading {
  word-wrap: break-word;
}

/* --- View Page Details --- */
.view-detail label {
  font-weight: 700;
  margin-bottom: 2px;
}

.view-detail p {
  margin-bottom: 10px;
  word-wrap: break-word;
}

/* --- Task Modal Table --- */
.task-modal-table th h5 {
  margin: 5px 0;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* --- Large Desktop (1200px+) --- */
@media (min-width: 1200px) {
  .header-logo-img {
    max-width: 450px;
    height: 50px;
  }

  .header-welcome-text {
    max-width: 400px;
  }
}

/* --- Medium Desktop / Tablet Landscape (992px - 1199px) --- */
@media (max-width: 1199px) {
  .header-logo-img {
    max-width: 300px;
    height: 42px;
  }

  .header-welcome-text {
    font-size: 12px;
    max-width: 250px;
  }
}

/* --- Tablet Portrait (768px - 991px) --- */
@media (max-width: 991px) {
  .header-logo-img {
    max-width: 200px;
    height: 38px;
  }

  .header-welcome-text {
    display: none !important;
  }

  .main-header .navbar-header {
    max-width: calc(100% - 120px);
  }

  .content-header h1 {
    font-size: 20px;
  }

  .login-box-size {
    min-height: auto;
    padding: 20px;
  }

  .login-logo-img {
    width: 100%;
    max-width: 400px;
  }

  /* Stack form columns */
  .box-body .col-md-4,
  .box-body .col-md-3 {
    padding-left: 10px;
    padding-right: 10px;
  }

  /* Salary slip adjustments */
  .salary-slip-table {
    font-size: 12px;
  }
}

/* --- Mobile Landscape / Small Tablet (576px - 767px) --- */
@media (max-width: 767px) {
  /* Header adjustments */
  .main-header .navbar-header {
    max-width: calc(100% - 100px);
  }

  .main-header .navbar-brand {
    padding: 5px 10px;
  }

  .header-logo-img {
    max-width: 160px;
    height: 35px;
  }

  .header-welcome-text {
    display: none !important;
  }

  .navbar-custom-menu > .nav > li > a {
    padding: 15px 8px;
  }

  .navbar-custom-menu > .nav > li > a > .label {
    font-size: 9px;
  }

  /* Content area */
  .content-wrapper {
    margin-left: 0 !important;
  }

  .content-header h1 {
    font-size: 18px;
  }

  .breadcrumb {
    font-size: 12px;
  }

  /* Tables */
  .table-responsive {
    border: 0;
  }

  .table > thead > tr > th,
  .table > tbody > tr > td {
    white-space: nowrap;
    font-size: 12px;
    padding: 5px 8px;
  }

  /* Forms */
  .box-body .col-md-4,
  .box-body .col-md-3,
  .box-body .col-md-6 {
    width: 100%;
    float: none;
  }

  /* Buttons */
  .content-header_button {
    text-align: center;
    margin-bottom: 10px;
  }

  .content-header_button .btn {
    margin-bottom: 5px;
    display: inline-block;
  }

  .box-footer .btn {
    width: 48%;
    margin-bottom: 5px;
  }

  /* Modals */
  .modal-dialog {
    margin: 10px;
  }

  /* Login page */
  .login-box-size {
    min-height: auto;
    padding: 15px;
    margin-right: 0 !important;
  }

  .login-logo-img {
    width: 100%;
    max-width: 300px;
  }

  .login-box {
    width: 100%;
    margin: 0 auto;
  }

  /* View pages */
  .panel-body .col-md-3,
  .panel-body .col-md-4 {
    width: 50%;
  }

  /* Salary slip */
  .salary-slip-table {
    font-size: 11px;
  }

  .salary-slip-table td {
    padding: 2px 4px;
  }

  /* Footer task modal */
  #taskmodal .table-responsive {
    overflow-x: auto;
  }

  /* Sidebar toggle improvements */
  .sidebar-mini.sidebar-collapse .content-wrapper {
    margin-left: 0 !important;
  }

  /* Box header + tools: AdminLTE absolutely positions .box-tools over the
     title, which overlaps/clips as soon as there's more than one button
     and a title on a narrow screen. Stack them instead. */
  .box-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-right: 10px;
  }

  .box-header > .box-tools {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .box-header > .box-tools.pull-right {
    float: none;
  }

  .box-header > .box-tools .btn {
    flex: none;
  }
}

/* --- Mobile Portrait (max-width: 575px) --- */
@media (max-width: 575px) {
  .main-header .navbar-header {
    max-width: calc(100% - 90px);
  }

  .main-header .navbar-brand {
    padding: 5px 8px;
  }

  .header-logo-img {
    max-width: 120px;
    height: 28px;
  }

  .navbar-custom-menu > .nav > li > a {
    padding: 15px 6px;
  }

  .user-image {
    width: 25px !important;
    height: 25px !important;
  }

  .content-header h1 {
    font-size: 16px;
  }

  .breadcrumb {
    display: none;
  }

  /* Full width columns on mobile */
  .panel-body .col-md-3,
  .panel-body .col-md-4 {
    width: 100%;
  }

  /* Table font size */
  .table > thead > tr > th,
  .table > tbody > tr > td {
    font-size: 11px;
    padding: 4px 6px;
  }

  /* DataTable controls */
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    text-align: center;
    float: none;
  }

  .dataTables_wrapper .dataTables_filter input {
    width: 100%;
    margin-left: 0;
  }

  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    text-align: center;
    float: none;
  }

  .dataTables_wrapper .dataTables_paginate .pagination {
    justify-content: center;
    flex-wrap: wrap;
  }

  /* Buttons stacked */
  .box-footer .btn {
    width: 100%;
    margin-bottom: 5px;
  }

  .content-header_button .btn {
    width: 100%;
    margin-bottom: 5px;
  }

  /* Filter dropdowns */
  .filter_search_data,
  .filter_search_data1,
  .filter_search_data2,
  .filter_search_data3,
  .filter_search_data4,
  .filter_search_data5 {
    width: 100% !important;
    margin-bottom: 5px;
  }

  /* Select2 responsive */
  .select2-container {
    width: 100% !important;
  }

  /* Modal improvements */
  .modal-dialog {
    margin: 5px;
    width: auto;
  }

  .modal-body {
    padding: 10px;
  }

  /* Salary slip mobile */
  .salary-slip-table {
    font-size: 10px;
  }

  /* Image thumbnails */
  .img-thumb-lg {
    width: 80px;
    height: 80px;
  }
}

/* --- Extra Small (max-width: 480px) --- */
@media (max-width: 480px) {
  body.login-page {
    padding: 10px;
  }

  .login-box-size {
    padding: 10px;
  }

  .login-box-msg {
    font-size: 14px;
  }

  /* Compact table mode */
  .table-responsive .table {
    min-width: 600px;
  }

  .salary-slip-table {
    min-width: 500px;
  }
}

/* --- Print Styles --- */
@media print {
  .main-header,
  .main-sidebar,
  .main-footer,
  .breadcrumb,
  .content-header_button,
  .box-footer,
  .btn {
    display: none !important;
  }

  .content-wrapper {
    margin-left: 0 !important;
    padding: 0;
  }

  .table {
    font-size: 11px;
  }

  .salary-slip-table {
    font-size: 10px;
  }
}
