/* ITEDUHUB ADMIN PORTAL - Complete Design System */
:root {
  --primary-color: #f8fafc;
  --secondary-color: #ffffff;
  --accent-color: #2563eb;
  --accent-hover: #1d4ed8;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  --card-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(0, 0, 0, 0.08);
  --success-color: #059669;
  --danger-color: #dc2626;
  --shadow-premium: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

body {
  background: var(--bg-gradient);
  color: var(--text-primary);
  font-family: 'Inter', 'Roboto', sans-serif;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--shadow-premium);
  padding: 2rem;
}

.btn-premium {
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-premium:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
  color: white;
}

.btn-outline-premium {
  background: transparent;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
  border-radius: 8px;
  padding: 0.6rem 1.4rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-outline-premium:hover {
  background: var(--accent-color);
  color: white;
}

.form-control-premium {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary) !important;
  padding: 0.75rem 1rem;
}

.form-control-premium:focus {
  background: #fff;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.navbar-premium {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.navbar-brand.text-accent {
  color: var(--accent-color) !important;
}

.nav-link-premium {
  color: var(--text-secondary) !important;
  font-weight: 500;
  margin: 0 1rem;
  transition: color 0.3s ease;
}

.nav-link-premium:hover,
.nav-link-premium.active {
  color: var(--accent-color) !important;
  font-weight: 700;
  position: relative;
  display: inline-block;
  width: fit-content; /* Force width to match text content */
}

.nav-link-premium.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-color);
  border-radius: 2px;
}

.table-premium {
  color: var(--text-primary);
  border-collapse: separate;
  border-spacing: 0 8px;
}

.table-premium thead th {
  border: none;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
}

.table-premium tbody tr {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.table-premium tbody tr:hover {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transform: translateY(-1px);
}

.table-premium td {
  border: none;
  padding: 1rem;
  vertical-align: middle;
  white-space: nowrap;
}

/* Mobile specific styles handle the wrapping/layout */

#Student_Table th:nth-child(1) { width: 50px; }
#Student_Table th:nth-child(2) { width: 150px; }
#Student_Table th:nth-child(3) { width: 80px; }
#Student_Table th:nth-child(4) { width: 200px; }
#Student_Table th:nth-child(5) { width: 120px; }
#Student_Table th:nth-child(6) { width: 250px; min-width: 250px; }

#Student_Table td:nth-child(6) {
  white-space: normal !important;
}

#Student_Table td:nth-child(6) .d-flex {
  flex-wrap: nowrap !important;
  gap: 0.5rem;
}

#Student_Table td:nth-child(6) .btn {
  white-space: nowrap;
  min-width: 100px;
}

#Notice_Table th:nth-child(1) { width: 50px; }
#Notice_Table th:nth-child(2) { width: auto; }
#Notice_Table th:nth-child(3) { width: 120px; }

.table-premium td:first-child {
  border-radius: 8px 0 0 8px;
}

.table-premium td:last-child {
  border-radius: 0 8px 8px 0;
}

.main-div {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

#login_card {
  max-width: 450px;
  width: 100%;
}

/* Responsive Table Fixes */
@media screen and (max-width: 768px) {
  .table-premium, 
  .table-premium thead, 
  .table-premium tbody, 
  .table-premium th, 
  .table-premium td, 
  .table-premium tr { 
    display: block; 
  }
  
  .table-premium thead tr { 
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  .table-premium tr { 
    background: #fff;
    border: 1px solid var(--glass-border);
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  }
  
  .table-premium td { 
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.03); 
    position: relative;
    padding-left: 50% !important; 
    text-align: right !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .table-premium td:last-child {
    border-bottom: 0;
  }
  
  .table-premium td:before { 
    position: absolute;
    top: 50%;
    left: 1rem;
    width: 45%; 
    padding-right: 10px; 
    white-space: nowrap;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    transform: translateY(-50%);
  }

  #Student_Table td:nth-of-type(1):before { content: "#"; }
  #Student_Table td:nth-of-type(2):before { content: "NAME"; }
  #Student_Table td:nth-of-type(3):before { content: "CLASS"; }
  #Student_Table td:nth-of-type(4):before { content: "SCHOOL"; }
  #Student_Table td:nth-of-type(5):before { content: "PHONE"; }
  #Student_Table td:nth-of-type(6):before { content: ""; }
  
  #Student_Table td:nth-of-type(6) {
    text-align: center !important;
    padding-left: 0 !important;
  }
  
  #Student_Table td:nth-of-type(6) .d-flex {
    justify-content: center !important;
  }

  #Notice_Table td:nth-of-type(1):before { content: "#"; }
  #Notice_Table td:nth-of-type(2):before { content: "CONTENT"; }
  #Notice_Table td:nth-of-type(3):before { content: "ACTIONS"; }

  .table-premium td .d-flex {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .table-premium td .btn {
    margin: 0 !important;
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
  }

  .navbar-premium {
    padding: 0.5rem 1rem;
  }
  .navbar-brand {
    font-size: 1rem;
  }
  
  .dataTables_filter {
    width: 100% !important;
    margin-bottom: 1rem !important;
  }
  
  .dataTables_filter input {
    width: 100% !important;
    max-width: 100% !important;
  }
}

.dataTables_wrapper {
  color: var(--text-secondary);
}

.dataTables_length select, .dataTables_filter input {
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  border-radius: 4px;
  padding: 4px;
}

.text-accent { color: var(--accent-color) !important; }
.text-primary-theme { color: var(--text-primary) !important; }
.text-secondary-theme { color: var(--text-secondary) !important; }
.bg-premium { background: var(--primary-color) !important; }
.success-message { color: var(--success-color); font-weight: 500; }

.modal-content.glass-card {
  border: none;
  background: var(--secondary-color);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-backdrop {
  background-color: rgba(15, 23, 42, 0.4) !important;
  backdrop-filter: blur(4px);
}
