/**
* Template Name: NiceAdmin (Modified for NPSC)
* Updated: Customized for National Police Service Commission AMS
*/

/*--------------------------------------------------------------
# General (Fix Layout Issues)
--------------------------------------------------------------*/
:root {
  scroll-behavior: smooth;
  --dark-blue: #1F3468;
  --white: #FFFFFF;
  --gold-yellow: #F4D20D;
  --red: #B72928;
}

body {
  font-family: "Open Sans", sans-serif;
  font-size: 16px;
  background: #f6f9ff;
  color: #444444;
  margin: 0;
  padding: 0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Prevent horizontal scrolling */
html, body {
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/*--------------------------------------------------------------
# Fixed Header (Ensures Consistency on All Pages)
--------------------------------------------------------------*/
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--dark-blue);
  padding: 15px 20px;
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  z-index: 1000;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
}


/* Header Title */
.header-title {
  font-size: 20px !important;
  font-weight: bold;
  color: var(--white);
  flex-grow: 1;
  text-align: left;
  margin: 0 auto; /* Centers the title */
}

/* User Info & Logout */
.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 16px !important;
  font-weight: bold;
  color: var(--gold-yellow);
  position: absolute;
  right: 20px; /* Fixes it to the right */
  top: 50%;
  transform: translateY(-50%); /* Ensures perfect vertical alignment */
}

.logout {
  background-color: var(--red);
  color: var(--white);
  padding: 6px 12px;
  font-size: 16px !important;
  font-weight: bold;
  border-radius: 5px;
  text-decoration: none;
  transition: 0.3s ease-in-out;
}

.logout i {
  font-size: 18px; /* Ensures icon size consistency */
  color: var(--white);
}

.logout:hover {
  background-color: var(--gold-yellow);
  color: var(--dark-blue);
}

.logout:hover i {
  color: var(--dark-blue);
}

/*--------------------------------------------------------------
# Sidebar (Fixed & Properly Connected to Header)
--------------------------------------------------------------*/
/* Sidebar */
.sidebar {
  width: 200px;
  background-color: var(--dark-blue);
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px; 
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
  
}

/* Sidebar Logo */
.sidebar-logo {
  display: flex;
  justify-content: left;
  align-items: center;
  width: 100%;
  padding: 10px 15px;
}

.sidebar-logo img {
  width: 70%;
  max-width: 120px;
  height: auto;
  display: block;
  margin: 0 auto;
  padding-top: 50px;
  

}

/* Sidebar Navigation */
.sidebar ul {
  list-style: none;
  padding: 0;
  width: 100%;
  margin: 0; /* Ensure there's no extra margin */
}

.sidebar ul li {
  width: 100%;
  margin-bottom: 4px; 
  justify-content: center;
}

.sidebar ul li a {
  display: flex;
  align-items: center;
  gap: 8px; /* Reduced gap between icon and text */
  padding: 6px 15px; /* Reduced padding */
  color: var(--white);
  font-size: 14px; /* Slightly smaller font size */
  font-weight: lighter;
  text-decoration: none;
  transition: 0.3s;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar ul li a i {
  font-size: 16px; /* Reduced icon size */
  color: var(--gold-yellow);
}

.sidebar ul li a:hover {
  background-color: var(--gold-yellow);
  color: var(--dark-blue);
  border-radius: 5px;
}

/* Active Page */
.sidebar ul li a.active {
  background-color: var(--gold-yellow);
  color: var(--dark-blue);
}

/*--------------------------------------------------------------
# Forms Styling (Professional Layout & Two Columns)
--------------------------------------------------------------*/
.form-container {
  background: var(--white);
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  max-width: 800px;
  margin: auto;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: space-between;
}

.form-group {
  display: flex;
  flex-direction: column;
  flex: 1 1 calc(47% - 15px);
  min-width: 260px;
}

.form-group label {
  font-weight: bold;
  color: var(--dark-blue);
  margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 14px;
  width: 95%;
}

@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
  }
  .form-group {
    flex: 1 1 100%;
  }
}

/* Submit Button Styling */
.form-actions {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.button {
  background-color: var(--red);
  color: var(--white);
  padding: 12px 20px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-weight: bold;
  border-radius: 5px;
  font-size: 16px;
  transition: 0.3s ease;
}

.button:hover {
  background-color: var(--gold-yellow);
  color: var(--dark-blue);
}

/* Responsive Layout for Small Screens */
@media (max-width: 768px) {
  .form-row {
      flex-direction: column;
  }
  .form-group {
      flex: 1 1 100%;
  }
}

/*--------------------------------------------------------------
# Table Styling (Professional & Responsive)
--------------------------------------------------------------*/
/* Ensure title is properly aligned */

.table-container {
  overflow-x: auto; /* Enables scrolling on smaller screens */
  margin: 20px auto;
  max-width: 95%;
  background: var(--white);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Table Base Styles */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  text-align: left;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #ddd; /* Table border */
}

/* Table Header */
table th {
    white-space: nowrap; /* Prevents line breaks */
    min-width: 120px; /* Ensures headers don’t shrink too much */
    text-align: left; /* Keeps text aligned */
}
/* Table Rows */
table tr {
  transition: 0.3s ease-in-out;
}

table tr:nth-child(even) {
  background: #f9f9f9; /* Alternate row background */
}

table tr:hover {
  background-color: #e3e8f0; /* Light hover effect */
}

/* Table Data Cells */
table td {
  padding: 12px 15px;
  border-bottom: 1px solid #ddd;
  text-align: left;
  font-size: 15px;
  font-weight: 400;
  white-space: nowrap; /* Prevents text wrapping */
}

/* Table Actions (Buttons inside Tables) */
.table-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap; /* Ensures proper spacing */
}

/* Buttons */

.add-asset-btn {
  background-color: var(--gold-yellow) !important; /* Ensures Gold color applies */
  color: var(--dark-blue) !important; /* Dark Blue Text */
  font-weight: bold;
  border-radius: 5px;
  padding: 10px 16px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px; /* Space between icon and text */
  border: none;
  transition: 0.3s ease-in-out;
  text-decoration: none;
}

.add-asset-btn i {
  font-size: 18px; /* Ensures icon size consistency */
}

.add-asset-btn:hover {
  background-color: var(--dark-blue) !important;
  color: var(--white) !important;
}


/*--------------------------------------------------------------
# Responsive Table - Prevents Compression on Smaller Screens
--------------------------------------------------------------*/
@media (max-width: 1024px) {
  .table-container {
    max-width: 100%;
    padding: 15px;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap; /* Prevents text from breaking */
  }

  /* Reduce font size for better readability */
  table th, table td {
    padding: 10px;
    font-size: 14px;
  }

  /* Ensure buttons don't overlap */
  .table-actions {
    gap: 5px;
    flex-wrap: nowrap;
  }
}

@media (max-width: 768px) {
  .table-actions {
    flex-direction: column; /* Stack buttons vertically */
    align-items: center;
  }

  .btn-edit,
  .btn-delete {
    width: 100%; /* Full width for better spacing */
    text-align: center;
  }
}



/*--------------------------------------------------------------
# Login Page Styling (NPSC Themed)
--------------------------------------------------------------*/
.login-container {
  background: var(--dark-blue);
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 100%;
  text-align: center;
  margin: auto;
}

.login-container h3 {
  color: var(--gold-yellow);
  margin-bottom: 20px;
  font-weight: bold;
}

.login-container .form-control {
  background: #ffffff;
  border: 1px solid var(--gold-yellow);
  border-radius: 5px;
  padding: 12px;
  font-size: 16px;
}

.login-container .form-control:focus {
  border-color: var(--red);
  box-shadow: 0 0 8px rgba(183, 41, 40, 0.5);
}

.login-container .btn-login {
  background-color: var(--gold-yellow);
  border: none;
  font-size: 18px;
  font-weight: bold;
  padding: 12px;
  border-radius: 5px;
  width: 100%;
  transition: all 0.3s ease-in-out;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

/* Button Hover Effect */
.login-container .btn-login:hover {
  background-color: var(--red);
  color: var(--white);
  transform: scale(1.05);
}

/* Button Click Effect */
.login-container .btn-login:active {
  transform: scale(0.98);
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.2);
}

/* Add Icon Styling */
.btn-login i {
  font-size: 20px;
  color: var(--dark-blue);
}

/* Button Disabled State */
.login-container .btn-login:disabled {
  background-color: #ccc;
  color: #666;
  cursor: not-allowed;
  transform: none;
}

/* Mobile Optimization */
@media (max-width: 768px) {
  .login-container .btn-login {
    font-size: 16px;
    padding: 10px;
  }
}

/* Centering the form */
.register {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

/* Fix NPSC Logo on Login Page */
.login-logo {
  max-width: 100px;
  height: auto;
  display: block;
  margin: 0 auto 10px;
}


/*--------------------------------------------------------------
# Dashboard Main Content (Ensures Proper Layout)
--------------------------------------------------------------*/
.main-content {
  margin-left: 260px; /* Sidebar width */
  padding: 100px 20px;
  min-height: 100vh;
  overflow-x: hidden;
  width: calc(100% - 260px); /* Prevents content from shifting left */
  
}

.main.dashboard-container {
  margin-left: 260px; /* Adjust based on sidebar width */
  padding: 20px;
  min-height: 100vh;
  overflow-x: hidden;
}
/*--------------------------------------------------------------
# Dashboard Cards (Ensuring Proper Grid Layout)
--------------------------------------------------------------*/
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 100px 20px;
  
}

/* Individual Cards */
.info-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  width: 25%; /* Ensures 4 cards fit in one row */
  min-width: 200px; /* Prevents shrinking too much */
  min-height: 200px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  
}


.info-card h5 {
  font-size: 16px;
  font-weight: bold;
  color: var(--dark-blue);
  margin-bottom: 5px;
  
}

.info-card h3 {
  font-size: 22px;
  font-weight: bold;
  color: var(--gold-yellow);
}

/* Card Icon Styling */
.card-icon {
  font-size: 2.5rem;
  padding: 15px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ensuring the icon box is centered */
.icon-box {
  width: 60px;
  height: 60px;
  background: var(--gold-yellow);
  color: var(--dark-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 26px;
  margin-bottom: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* Different Colors for Each Section */
.info-card.assigned {
  border-top: 4px solid var(--gold-yellow);
}

.info-card.faulty {
  border-top: 4px solid var(--red);
}

.info-card.users {
  border-top: 4px solid var(--dark-blue);
}

/* Hover Effect */
.info-card:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

canvas {
  display: block;
  max-width: 100%;
  height: auto !important;
}


/*--------------------------------------------------------------
# Responsive Fixes (Ensuring Proper Card Layout)
--------------------------------------------------------------*/
@media (min-width: 1200px) {
  .dashboard-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1199px) {
  .dashboard-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 991px) {
  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .dashboard-stats {
    grid-template-columns: repeat(1, 1fr);
  }
}


/* Ensure Consistent Scrollbar on All Pages */
html {
  overflow-y: scroll; /* Always show vertical scrollbar */
}


/*--------------------------------------------------------------
# Footer (Ensures Layout Consistency)
--------------------------------------------------------------*/
.footer {
  text-align: center;
  background-color: var(--dark-blue);
  color: var(--white);
  padding: 10px 0;
  font-size: 14px;
  position: relative;
  bottom: 0;
  width: 100%;
}

/*--------------------------------------------------------------
# Custom Modal Button Colors (Align with System Theme)
--------------------------------------------------------------*/

/* Primary Action Button (Gold Yellow) */

.btn-primary {
  background-color: var(--dark-blue) !important;
  color: var(--white) !important;
  font-weight: bold;
  border-radius: 5px;
  padding: 10px 16px;
  font-size: 16px;
  transition: 0.3s ease-in-out;
  border: none;
}

.btn-primary:hover {
  background-color: var(--gold-yellow) !important; 
  color: var(--dark-blue) !important;
}



.btn-gold {
  background-color: var(--dark-blue) !important;
  color: var(--white) !important;
  font-weight: bold;
  border-radius: 5px;
  padding: 10px 16px;
  font-size: 16px;
  transition: 0.3s ease-in-out;
  border: none;
}

.btn-gold:hover {
  background-color: var(--gold-yellow) !important;
  color: var(--dark-blue) !important;
}

/* Cancel Button (Dark Blue) */
.btn-secondary {
  background-color: var(--gold-yellow) !important;
  color: var(--white) !important;
  font-weight: bold;
  transition: 0.3s ease-in-out;
}

.btn-secondary:hover {
  background-color: var(--gold-yellow) !important;
  color: var(--dark-blue) !important;
}

/* Danger Button (Delete Actions) */
.btn-danger {
  background-color: var(--red) !important;
  color: var(--white) !important;
  font-weight: bold;
  transition: 0.3s ease-in-out;
}

.btn-danger:hover {
  background-color: #8b0000;
}
