:root {
  --purple: #6366f1;
  --blue: #3b82f6;
  --orange: #f97316;
  --red: #ef4444;
  --pink: #ec4899;
  --yellow: #eab308;
  --green: #10b981;
  --light-bg: #f5f7fa;
  --white: #ffffff;
  --text-primary: #1a202c;
  --text-secondary: #718096;
  --border-color: #e2e8f0;
}

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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--light-bg);
  color: var(--text-primary);
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}
/* Navigation Bar */
.navbar {
  background: var(--white);
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.img {
  inset: 0;
  object-fit: cover;
  background-size: cover;
  background-position: center;
  z-index: 3;
}
.navbar .container-fluid {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  width: 50px;
  height: 50px;
  background: var(--purple);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-main {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-primary);
}

.logo-hub {
  color: var(--purple);
}

.logo-tagline {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: -4px;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.btn-primary {
  background: var(--purple);
  border: none;
  color: white;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: #4f46e5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.nav-icons {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
}

.nav-icons i {
  transition: all 0.3s ease;
}

.nav-icons i:hover {
  color: var(--purple);
  transform: scale(1.1);
}

.profile-pic img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  cursor: pointer;
}

/* Dashboard Cards */
.dashboard-cards {
  padding: 2rem;
}

.stat-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
}

.stat-total .stat-icon {
  background: var(--blue);
}

.stat-favorites .stat-icon {
  background: var(--orange);
}

.stat-emergency .stat-icon {
  background: var(--red);
}

.stat-info {
  flex: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.stat-value {
  font-size: 32px;
  font-weight: bold;
  color: var(--text-primary);
}

/* Main Content */
.main-content {
  padding: 2rem;
}

.contacts-section {
  padding: 2rem;
}

.section-header h2 {
  font-size: 28px;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: bold;
}

.section-subtitle {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.search-bar {
  position: relative;
  margin-bottom: 2rem;
}

.search-bar i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.search-bar input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 3rem;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-bar input::placeholder {
  color: var(--text-secondary);
}

/* Contact Cards */
.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.contact-card:hover {
  border-color: var(--purple);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.contact-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.contact-avatar {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 20px;
  color: white;
  position: relative;
}

.contact-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Favorite Badge - Top Right */
.contact-avatar.favorite::after {
  content: "\f005";

  font-family: "Font Awesome 6 Free";
  font-weight: 900;

  position: absolute;
  top: -6px;
  right: -6px;
  border: 1px solid var(--white);
  border-radius: 50%;
  padding: 5px;
  background: var(--yellow);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  z-index: 2;
  color: var(--white);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

/* Emergency Badge - Bottom Right */
.contact-avatar.emergency::before {
  content: "\f004";
  font-family: "Font Awesome 6 Free";
  background: var(--red);
  border-radius: 50%;
  padding: 5px;
  font-weight: 900;
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border: 1px solid var(--white);
  z-index: 2;
  color: var(--white);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.contact-info h4 {
  font-size: 18px;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
  font-weight: bold;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.contact-detail {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 14px;
  color: var(--text-primary);
}

.contact-detail i {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  flex-shrink: 0;
}

.contact-detail.phone i {
  background: rgba(59, 130, 246, 0.1);
  color: var(--blue);
}

.contact-detail.email i {
  background: rgba(99, 102, 241, 0.1);
  color: var(--purple);
}

.contact-detail.address i {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
}

.contact-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tag {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tag.family {
  background: var(--blue);
  color: white;
}

.tag.friends,
.tag.work,
.tag.school,
.tag.other {
  background: #f7fafc;
  color: var(--text-secondary);
}

.tag.emergency {
  background: var(--red);
  color: white;
}

.tag.emergency i {
  margin-right: 0.25rem;
  color: white;
}

.contact-actions {
  display: flex;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.contact-action {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0.5rem;
  border-radius: 8px;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-action:hover {
  transform: scale(1.1);
}

.contact-action.call {
  color: var(--green);
  background: rgba(16, 185, 129, 0.1);
  width: 36px;
  height: 36px;
}

.contact-action.email {
  color: var(--purple);
  background: rgba(99, 102, 241, 0.1);
  width: 36px;
  height: 36px;
}

.contact-action.favorite {
  color: var(--text-secondary);
  background: none;
}

.contact-action.favorite.active {
  color: var(--yellow);
  background: rgba(234, 179, 8, 0.1);
}

.contact-action.emergency {
  color: var(--text-secondary);
  background: none;
}

.contact-action.emergency.active {
  color: var(--red);
  background: rgba(236, 72, 153, 0.1);
}

.contact-action.delete {
  color: var(--red);
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-section {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sidebar-section:first-child {
  background: linear-gradient(
    to bottom,
    rgba(234, 179, 8, 0.05) 0%,
    var(--white) 15%
  );
}

.sidebar-section:last-child {
  background: linear-gradient(
    to bottom,
    rgba(236, 72, 153, 0.05) 0%,
    var(--white) 15%
  );
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.sidebar-header i {
  font-size: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.sidebar-section:first-child .sidebar-header i {
  color: white;
  background: var(--orange);
}

.sidebar-section:last-child .sidebar-header i {
  color: white;
  background: var(--red);
}

.sidebar-header h3 {
  font-size: 20px;
  margin: 0;
  color: var(--text-primary);
  font-weight: bold;
}

.sidebar-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 1rem;
}

.favorites-list,
.emergency-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.empty-state {
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem;
  font-style: italic;
}

.sidebar-contact-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sidebar-contact-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.sidebar-contact-avatar {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-contact-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-contact-info {
  flex: 1;
}

.sidebar-contact-info h5 {
  font-size: 16px;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
  font-weight: bold;
}

.sidebar-contact-info p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.sidebar-call-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.sidebar-call-btn.favorites-call {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
}

.sidebar-call-btn.favorites-call:hover {
  background: var(--green);
  color: white;
  transform: scale(1.1);
}

.sidebar-call-btn.emergency-call {
  background: rgba(236, 72, 153, 0.1);
  color: var(--red);
}

.sidebar-call-btn.emergency-call:hover {
  background: var(--red);
  color: white;
  transform: scale(1.1);
}

/* Modal Styles */
.modal-content {
  background: var(--white);
  border: none;
  border-radius: 16px;
  color: var(--text-primary);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-primary);
  margin: 0;
}

.btn-close {
  opacity: 0.5;
  padding: 0.5rem;
  margin: 0;
}

.btn-close:hover {
  opacity: 1;
}

.modal-body {
  padding: 2rem;
}

.contact-photo-section {
  text-align: center;
  margin-bottom: 2rem;
}

.contact-photo-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 48px;
  color: white;
  border: none;
  position: relative;
}

.contact-photo-preview img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.btn-secondary {
  background: var(--white);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--light-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 14px;
  margin-top: 0.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
}

.required {
  color: var(--red);
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
}

.form-control:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder {
  color: var(--text-secondary);
}

.form-control select {
  cursor: pointer;
}

.form-checkboxes {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-check-input {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--purple);
}

.form-check-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text-primary);
}

.form-check-label i {
  font-size: 16px;
}

.form-check:first-child .form-check-label i {
  color: var(--orange);
}

.form-check:last-child .form-check-label i {
  color: var(--red);
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.btn-primary i {
  margin-right: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    padding: 1rem;
  }

  .logo-text {
    display: none;
  }

  .navbar-actions {
    gap: 1rem;
  }

  .btn-primary {
    padding: 0.5rem 1rem;
    font-size: 14px;
  }

  .dashboard-cards {
    padding: 1rem;
  }

  .main-content {
    padding: 1rem;
  }

  .contacts-section {
    padding: 1.5rem;
  }
}
