/*
 * Learning Islam Online - Portal Custom Enhancements
 * Matches style.css Emerald Green (#0a4d33) & Champagne Gold (#c5a880)
 */

/* Profile Avatar & Dropdown */
.user-menu-wrapper {
  position: relative;
  display: inline-block;
}

.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.user-avatar-btn:hover {
  opacity: 0.95;
}

.avatar-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a4d33, #126b4a);
  color: #c5a880;
  border: 2px solid #c5a880;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headings, 'Outfit', sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(10, 77, 51, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-avatar-btn:hover .avatar-circle {
  transform: scale(1.05);
  box-shadow: 0 6px 14px rgba(197, 168, 128, 0.35);
}

.avatar-meta {
  text-align: left;
  line-height: 1.2;
}

.avatar-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main, #1f2937);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar-role-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 9999px;
}

.role-admin {
  background: #fee2e2;
  color: #991b1b;
}

.role-teacher {
  background: #dbeafe;
  color: #1e40af;
}

.role-student {
  background: #d1fae5;
  color: #065f46;
}

/* Dropdown Menu */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 270px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 15px 35px rgba(10, 77, 51, 0.15), 0 5px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(197, 168, 128, 0.3);
  padding: 12px;
  display: none;
  z-index: 1050;
  animation: dropdownFadeIn 0.2s ease forwards;
}

.user-dropdown-menu.show {
  display: block;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-user-header {
  padding: 8px 12px 12px;
  border-bottom: 1px solid #f1f5f9;
}

.dropdown-user-header .full-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.dropdown-user-header .user-email {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 8px;
  word-break: break-all;
}

.dropdown-tz-pill {
  font-size: 0.72rem;
  color: #0a4d33;
  background: #f4fbf7;
  border: 1px solid #d1fae5;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.dropdown-nav-list {
  list-style: none;
  padding: 8px 0;
  margin: 0;
}

.dropdown-nav-list li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: #334155;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.dropdown-nav-list li a:hover {
  background: #f8fafc;
  color: #0a4d33;
  padding-left: 15px;
}

.dropdown-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 4px 0;
}

.dropdown-logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  color: #dc2626 !important;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.dropdown-logout-btn:hover {
  background: #fef2f2 !important;
  color: #b91c1c !important;
}

/* Dashboard UI Components */
.dashboard-page {
  padding-top: 100px;
  padding-bottom: 60px;
  min-height: 80vh;
  background: var(--bg-primary, #fcfbfa);
}

.dashboard-header-card {
  background: linear-gradient(135deg, #0a4d33 0%, #052a1c 100%);
  color: white;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(10, 77, 51, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.dashboard-header-card h1 {
  font-family: var(--font-headings, 'Outfit', sans-serif);
  font-size: 1.85rem;
  margin-bottom: 0.35rem;
  color: #ffffff;
}

.dashboard-header-card p {
  color: #c5a880;
  font-size: 0.95rem;
}

.tz-badge {
  background: rgba(197, 168, 128, 0.2);
  border: 1px solid rgba(197, 168, 128, 0.4);
  color: #dfc299;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Cards Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.portal-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 4px 20px rgba(10, 77, 51, 0.06);
  border: 1px solid rgba(197, 168, 128, 0.25);
  display: flex;
  flex-direction: column;
}

.portal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.portal-card-header h2 {
  font-family: var(--font-headings, 'Outfit', sans-serif);
  font-size: 1.25rem;
  color: #0a4d33;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Table styles */
.portal-table {
  width: 100%;
  border-collapse: collapse;
}

.portal-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
}

.portal-table td {
  padding: 12px;
  font-size: 0.88rem;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.portal-table tr:hover td {
  background: #fafcfb;
}

.time-highlight {
  font-weight: 700;
  color: #0a4d33;
}

.time-sub {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
}

.btn-join-class {
  background: linear-gradient(135deg, #0a4d33, #126b4a);
  color: white !important;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(10, 77, 51, 0.2);
}

.btn-join-class:hover {
  background: #052a1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(10, 77, 51, 0.3);
}

/* Prayer Times Strip */
.prayer-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.prayer-box {
  background: #fdfaf6;
  border: 1px solid rgba(197, 168, 128, 0.35);
  border-radius: 12px;
  padding: 0.85rem 0.5rem;
  text-align: center;
  transition: all 0.2s ease;
}

.prayer-box.active {
  background: #0a4d33;
  color: white;
  border-color: #c5a880;
  box-shadow: 0 6px 15px rgba(10, 77, 51, 0.25);
}

.prayer-box.active .prayer-name {
  color: #dfc299;
}

.prayer-box.active .prayer-time {
  color: #ffffff;
}

.prayer-name {
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.prayer-time {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0a4d33;
  font-family: var(--font-headings, 'Outfit', sans-serif);
}



/* ==============================================================
 * Profile Page & Modal Component Styles
 * ============================================================== */

.profile-container {
  max-width: 980px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

.profile-hero-card {
  background: linear-gradient(135deg, #052a1c 0%, #0a4d33 70%, #052a1c 100%);
  border-radius: 16px;
  padding: 2rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 10px 25px rgba(10, 77, 51, 0.2);
}

.profile-hero-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.profile-avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--portal-gold, #c5a880);
  color: #052a1c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  font-weight: 800;
  border: 3px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.profile-title-name {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-headings, 'Outfit', sans-serif);
  letter-spacing: -0.01em;
  color: #ffffff;
}

.profile-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.profile-role-badge {
  background: rgba(197, 168, 128, 0.25);
  border: 1px solid #c5a880;
  color: #fef08a;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-meta-email {
  color: #e2e8f0;
  font-size: 0.88rem;
}

.btn-profile-password {
  background: var(--portal-gold, #c5a880);
  color: #052a1c;
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.btn-profile-password:hover {
  background: #d4b890;
  transform: translateY(-1px);
}

.profile-notice-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-left: 4px solid #0a4d33;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.5;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.profile-field-group {
  margin-bottom: 0;
}

.profile-field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.profile-field-value {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  color: #1e293b;
  font-weight: 600;
}

.profile-badge-locked {
  font-size: 0.75rem;
  background: #f1f5f9;
  color: #64748b;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Modal Popup Classes */
.portal-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.55);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(3px);
}

.portal-modal-container {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(197, 168, 128, 0.4);
}

.portal-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.portal-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0a4d33;
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.portal-modal-close:hover {
  color: #0f172a;
}

/* Password Visibility Toggle */
.password-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  padding-right: 2.75rem !important;
  width: 100%;
  box-sizing: border-box;
}

.password-toggle-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
  z-index: 2;
  user-select: none;
}

.password-toggle-btn:hover {
  color: #0a4d33;
  background: rgba(10, 77, 51, 0.06);
}

.password-toggle-btn:focus-visible {
  outline: 2px solid #0a4d33;
  outline-offset: 1px;
}

/* DOB Age Badge */
.dob-age-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 2px 9px;
  border-radius: 9999px;
  margin-left: 8px;
  vertical-align: middle;
  transition: all 0.2s ease;
}

.dob-age-badge.empty {
  display: none;
}

/* ==============================================================
 * Responsive Tables & Simple-DataTables Emerald Theme
 * ============================================================== */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
  border-radius: 8px;
}

.datatable-wrapper {
  width: 100%;
}

.datatable-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin: 8px 0;
}

.datatable-top,
.datatable-bottom {
  padding: 10px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.datatable-input {
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s;
  min-width: 220px;
}

.datatable-input:focus {
  border-color: #0a4d33;
  box-shadow: 0 0 0 3px rgba(10, 77, 51, 0.12);
}

.datatable-selector {
  padding: 0.45rem 0.75rem;
  font-size: 0.88rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background-color: #fff;
  outline: none;
}

.datatable-pagination ul {
  display: flex;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.datatable-pagination li a {
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
  color: #334155;
  background: #f1f5f9;
  text-decoration: none;
  transition: all 0.15s;
}

.datatable-pagination li.active a,
.datatable-pagination li a:hover {
  background: #0a4d33 !important;
  color: #ffffff !important;
}

.datatable-info {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 500;
}
