/*
 * Admin Modern - Bootstrap 5.3 Custom Theme
 */

:root {
  --primary: #1b458e;
  --primary-dark: #0f2a5c;
  --primary-light: #2563eb;
  --secondary: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --navbar-height: 60px;

  --sidebar-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  --sidebar-text: #94a3b8;
  --sidebar-active: #ffffff;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.1);

  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --card-shadow-hover:
    0 10px 20px rgba(0, 0, 0, 0.15), 0 3px 6px rgba(0, 0, 0, 0.1);

  --body-bg: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-white: #ffffff;
  --border-color: #e2e8f0;

  --transition-base: all 0.3s ease;
}

/* ========================================
   BODY & LAYOUT
   ======================================== */
body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: url('../assets/images/bg_login.png');
  color: var(--text-primary);
  overflow-x: hidden;
}

/* #preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#preloader #status {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
} */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.main-wrapper {
  display: flex;
  min-height: 100vh;
}

.content-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: var(--transition-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding: 24px;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 1040;
  transition: var(--transition-base);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 80px;
}

.sidebar-header img {
  max-width: 160px;
  height: auto;
  filter: brightness(0) invert(1);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.nav-item {
  margin-bottom: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 8px;
  transition: var(--transition-base);
  font-size: 14px;
  font-weight: 500;
}

.nav-link i {
  width: 24px;
  margin-right: 12px;
  font-size: 18px;
  text-align: center;
}

.nav-link:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-active);
}

.nav-link.active {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  color: #fff;
  box-shadow: 0 4px 12px rgba(27, 69, 142, 0.4);
}

.nav-submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  padding-left: 52px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.nav-submenu.show {
  max-height: 500px;
}

.nav-submenu .nav-link {
  padding: 10px 16px;
  font-size: 13px;
}

.nav-toggle {
  cursor: pointer;
}

.nav-toggle::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-left: auto;
  font-size: 10px;
  transition: var(--transition-base);
}

.nav-toggle.collapsed::after {
  transform: rotate(-90deg);
}

/* ========================================
   NAVBAR
   ======================================== */
.top-navbar {
  height: var(--navbar-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar-toggle {
  display: block;
  padding: 8px;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 8px;
  transition: var(--transition-base);
}

.sidebar-toggle:hover {
  background: var(--body-bg);
}

/* Sidebar Collapsed State (Desktop) */
@media (min-width: 992px) {
  .sidebar.collapsed {
    width: var(--sidebar-collapsed);
  }

  .sidebar.collapsed .sidebar-header {
    padding: 10px;
  }

  .sidebar.collapsed .sidebar-header img {
    max-width: 40px;
  }

  .sidebar.collapsed .sidebar-nav {
    padding: 16px 8px;
  }

  .sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px 0;
  }

  .sidebar.collapsed .nav-link span {
    display: none;
  }

  .sidebar.collapsed .nav-link i {
    margin: 0;
    width: 100%;
    text-align: center;
  }

  .sidebar.collapsed .nav-toggle::after {
    display: none;
  }

  .sidebar.collapsed .nav-submenu {
    display: none !important;
  }

  .sidebar.collapsed ~ .content-wrapper {
    margin-left: var(--sidebar-collapsed);
  }
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.church-info select {
  padding-right: 30px;
  max-width: 350px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  background-position: right 10px center;
}

.user-dropdown .btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--body-bg);
  border: none;
  border-radius: 50px;
  font-weight: 500;
  color: var(--text-primary);
  transition: var(--transition-base);
}

.user-dropdown .btn:hover {
  background: var(--primary);
  color: #fff;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

/* ========================================
   CARDS
   ======================================== */
.card {
  background: var(--card-bg);
  border: none;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  transition: var(--transition-base);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 20px 24px;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
}

.card-header.bg-primary {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  ) !important;
  color: #fff;
  border: none;
}

.card-body {
  padding: 24px;
}

.card-title {
  font-weight: 600;
  margin-bottom: 8px;
}

/* Page Header Card */
.page-header-card {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  color: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.page-header-card h3 {
  margin: 0;
  font-weight: 600;
  font-size: 24px;
}

/* Section Headers */
.section-header {
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 16px;
  text-align: center;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  font-weight: 500;
  border-radius: 8px;
  padding: 10px 20px;
  transition: var(--transition-base);
  border: none;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  box-shadow: 0 4px 12px rgba(27, 69, 142, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(
    135deg,
    var(--primary-dark) 0%,
    var(--primary) 100%
  );
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(27, 69, 142, 0.35);
}

.btn-secondary {
  background: var(--secondary);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.btn-info {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-outline-secondary {
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  background: transparent;
}

.btn-outline-secondary:hover {
  background: var(--body-bg);
  border-color: var(--secondary);
}

/* ========================================
   FORMS
   ======================================== */
.form-control,
.form-select {
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  transition: var(--transition-base);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 69, 142, 0.1);
}

.form-label {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.input-group-text {
  background: rgba(189, 189, 189, 0.95);
  border: none;
  color: #000;
  border-radius: 8px 0 0 8px;
}

/* ========================================
   TABLES
   ======================================== */
.table {
  margin-bottom: 0;
}

.table thead th {
  background: var(--body-bg);
  border: none;
  padding: 16px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table tbody td {
  padding: 16px;
  vertical-align: middle;
  border-color: var(--border-color);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
  background-color: rgba(27, 69, 142, 0.05);
}

/* ========================================
   FILTER BAR
   ======================================== */
.filter-bar {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
}

.filter-bar .row {
  align-items: flex-end;
}

.filter-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ========================================
   FOOTER
   ======================================== */
.main-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: 16px 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.main-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

/* ========================================
   LOGIN PAGE
   ======================================== */
.login-page {
  min-height: 100vh;
  background: url('../images/bg_login.png');
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: rgba(0, 0, 0, 0.61);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 48px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-footer {
  text-align: center;
  margin-top: 32px;
}

.login-logo-footer img {
  max-width: 200px;
  height: auto;
}

.login-logo img {
  max-width: 300px;
  height: auto;
}

.login-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 8px;
}

.login-subtitle {
  text-align: center;
  color: var(--text-white);
  margin-bottom: 32px;
}

.login-form .input-group {
  margin-bottom: 20px;
}

.login-form .input-group-text {
  width: 50px;
  justify-content: center;
}

.login-form .form-control {
  border-left: none;
  border-radius: 0 8px 8px 0;
}

.btn-login {
  background: #d4b353;
  border: none;
  color: #000;
}

.btn-login:hover {
  background: #b89947;
  border: none;
  color: #000;
}

.login-form .btn-login {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  margin-top: 8px;
}

/* ========================================
   UTILITIES
   ======================================== */
.bg-gradient-primary {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  ) !important;
}

.bg-gradient-success {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%) !important;
}

.bg-gradient-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%) !important;
}

.bg-gradient-danger {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%) !important;
}

.text-gradient {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rounded-xl {
  border-radius: 12px !important;
}

.shadow-soft {
  box-shadow: var(--card-shadow) !important;
}

/* Box styles (compatibility with existing classes) */
.box {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  margin-bottom: 24px;
}

.box-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.box-body {
  padding: 24px;
}

.box-title {
  margin: 0;
  font-weight: 600;
  font-size: 16px;
}

.solaris-header {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  color: #fff;
  border-radius: 12px;
  margin-bottom: 20px;
}

.solaris-header .box-header {
  border: none;
}

.solaris-header .box-title {
  color: #fff;
}

/* BXS User cards (compatibility) */
.bxs_user {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 0;
  margin-bottom: 20px;
}

.bxs_user .header {
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%) !important;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px 12px 0 0;
  font-weight: 600;
  font-size: 16px;
  text-align: center;
  margin: 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .content-wrapper {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: block;
  }

  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    display: none;
  }

  .sidebar-backdrop.show {
    display: block;
  }
}

@media (max-width: 767.98px) {
  .main-content {
    padding: 16px;
  }

  .card-body {
    padding: 16px;
  }

  .login-card {
    padding: 32px 24px;
  }

  .filter-actions {
    width: 100%;
    margin-top: 16px;
  }

  .filter-actions .btn {
    flex: 1;
  }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Smooth page transitions */
.main-content {
  animation: fadeIn 0.3s ease-out;
}
