/* ============================================
   Imam Deeds - Site Header & Navigation
   Professional, responsive layout
   ============================================ */

:root {
  --id-primary: #F05325;
  --id-primary-dark: #c9441e;
  --id-primary-light: rgba(240, 83, 37, 0.08);
  --id-dark: #1a1a1a;
  --id-text: #333;
  --id-text-muted: #5c5c5c;
  --id-border: #e8e8e8;
  --id-header-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --id-nav-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ----- Top bar (contact strip) ----- */
.id-topbar {
  background: #F05325;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.8125rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.id-topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.id-topbar-welcome {
  font-weight: 500;
  letter-spacing: 0.02em;
}

.id-topbar-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.id-topbar-contact a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.id-topbar-contact a:hover {
  color: #fff;
  opacity: 0.9;
}

.id-topbar-contact i {
  font-size: 0.9rem;
  opacity: 0.9;
}

@media (max-width: 576px) {
  .id-topbar {
    font-size: 0.75rem;
    padding: 0.4rem 0;
  }
  .id-topbar-inner {
    justify-content: center;
    text-align: center;
  }
  .id-topbar-contact {
    justify-content: center;
    gap: 1rem;
  }
}

/* ----- Main header (logo + login) ----- */
.id-main-header {
  background: #fff;
  padding: 1rem 0;
  border-bottom: 1px solid var(--id-border);
  box-shadow: var(--id-header-shadow);
}

.id-main-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.id-logo-wrap {
  flex-shrink: 0;
}

.id-logo-wrap a {
  display: block;
  line-height: 0;
}

.id-logo-wrap img {
  height: 52px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  object-position: left center;
}

.id-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Inline login form: compact and professional */
.id-login-form {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--id-border);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Icon + input wrapper */
.id-login-form .id-input-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
  flex: 0 0 auto;
}

.id-login-form .id-input-wrap i {
  position: absolute;
  left: 0.7rem;
  color: #8c8c8c;
  font-size: 0.95rem;
  pointer-events: none;
  z-index: 1;
  transition: color 0.2s ease;
}

.id-login-form .id-input-wrap:focus-within i {
  color: var(--id-primary);
}

.id-login-form .id-input-wrap:first-of-type {
  border-right: 1px solid var(--id-border);
}

.id-login-form .form-control {
  width: 150px;
  min-width: 0;
  font-size: 0.8125rem;
  border: none !important;
  border-radius: 0;
  padding: 0 0.75rem 0 2.15rem;
  height: 100%;
  background: #fff;
}

.id-login-form .form-control:focus {
  box-shadow: none;
  outline: none;
}

.id-login-form .form-control::placeholder {
  color: #999;
}

.id-login-form .id-btn-login {
  height: 100%;
  border-radius: 0;
  padding: 0 1rem;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.id-btn-login {
  background: var(--id-primary) !important;
  color: #fff !important;
  border: none;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0 1rem;
  height: 36px;
  line-height: 1;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.id-btn-login:hover {
  background: var(--id-primary-dark) !important;
  color: #fff !important;
}

.id-btn-account {
  background: var(--id-primary) !important;
  color: #fff !important;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s ease, transform 0.15s ease;
}

.id-btn-account:hover {
  background: var(--id-primary-dark) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.id-btn-logout {
  background: #dc3545 !important;
  color: #fff !important;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.id-btn-logout:hover {
  background: #bb2d3b !important;
  color: #fff !important;
}

@media (max-width: 768px) {
  .id-main-header-inner {
    flex-direction: column;
    text-align: center;
  }
  .id-logo-wrap {
    order: 1;
  }
  .id-logo-wrap img {
    max-height: 48px;
  }
  .id-header-actions {
    order: 2;
    width: 100%;
    justify-content: center;
  }
  .id-login-form {
    width: auto;
    max-width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  .id-login-form .id-input-wrap {
    flex: 0 0 auto;
  }
  .id-login-form .form-control {
    width: 130px;
    min-width: 120px;
  }
}

@media (max-width: 400px) {
  .id-login-form {
    flex-direction: column;
    height: auto;
    width: 100%;
  }
  .id-login-form .id-input-wrap {
    width: 100%;
    border-right: none !important;
    border-bottom: 1px solid var(--id-border);
  }
  .id-login-form .id-input-wrap:last-of-type {
    border-bottom: none;
  }
  .id-login-form .form-control {
    width: 100% !important;
    max-width: 100%;
    height: 36px;
    flex: 1;
  }
  .id-login-form .id-btn-login {
    width: 100%;
  }
  .id-header-actions .d-flex {
    flex-direction: column;
    width: 100%;
  }
  .id-header-actions .d-flex a,
  .id-header-actions .d-flex .btn {
    width: 100%;
  }
}

/* ----- Main navigation ----- */
.id-nav-wrap {
  background: linear-gradient(180deg, var(--id-primary) 0%, var(--id-primary-dark) 100%);
  box-shadow: var(--id-nav-shadow);
  position: relative;
  z-index: 1020;
}

.id-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.id-navbar {
  padding: 0;
  min-height: 50px;
}

.id-navbar .navbar-toggler {
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
}

.id-navbar .navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.id-navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.id-navbar .navbar-nav {
  gap: 0;
}

.id-navbar .nav-link {
  color: rgba(255, 255, 255, 0.95) !important;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.85rem 1rem !important;
  letter-spacing: 0.02em;
  border-bottom: 3px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.id-navbar .nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff !important;
  border-bottom-color: rgba(255, 255, 255, 0.5);
}

.id-navbar .nav-link.dropdown-toggle::after {
  margin-left: 0.35em;
  vertical-align: 0.2em;
}

.id-navbar .dropdown-menu {
  border: none;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  padding: 0.35rem 0;
  margin-top: 0;
  min-width: 220px;
}

.id-navbar .dropdown-item {
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  color: var(--id-text);
  transition: background 0.15s ease, color 0.15s ease;
}

.id-navbar .dropdown-item:hover {
  background: var(--id-primary-light);
  color: var(--id-primary-dark);
}

.id-navbar .dropdown-item:active {
  background: var(--id-primary-light);
}

/* Mobile nav */
.id-navbar .navbar-collapse {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

@media (min-width: 992px) {
  .id-navbar .navbar-collapse {
    border-top: none;
  }
  .id-navbar .navbar-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 991px) {
  .id-navbar .nav-link {
    padding: 0.75rem 1rem !important;
    border-bottom: none;
    border-left: 3px solid transparent;
  }
  .id-navbar .nav-link:hover {
    border-left-color: rgba(255, 255, 255, 0.6);
  }
  .id-navbar .dropdown-menu {
    margin-left: 1rem;
    margin-bottom: 0.25rem;
    border-radius: 6px;
    min-width: 200px;
  }
}

/* Error message in header */
.id-header-error {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}
