/* --------- BASE MODAL SYSTEM -----------*/
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 10, 40, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: calc(100% - 48px);
  max-width: 420px;
  background: #ffffff;
  border-radius: 22px;
  padding: 22px 20px 20px;
  box-shadow: 0 20px 40px rgba(120, 80, 200, 0.25),
    0 4px 12px rgba(0, 0, 0, 0.08);
  transform: scale(0.94) translateY(10px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease;
}

.modal.open .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-content h3 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
  color: #1f1b2e;
}

.modal-content input,
.modal-content select {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: 1px solid #ece8f5;
  background: #faf9ff;
  padding: 0 14px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #2b2540;
  outline: none;
  transition: border 0.2s ease, background 0.2s ease;
}

.modal-content input:focus,
.modal-content select:focus {
  border-color: #9b6cff;
  background: #ffffff;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.modal-actions button {
  flex: 1;
  height: 44px;
  border-radius: 14px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.modal-actions button:active {
  transform: scale(0.96);
}

.modal-actions button:last-child {
  background: linear-gradient(135deg, #9b6cff, #7b4dff);
  color: #ffffff;
}

.modal button {
  -webkit-tap-highlight-color: transparent;
}

/* --------- PASSWORD ACTION MODAL -----------*/
#actionModal button {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: none;
  margin-bottom: 10px;
  font-size: 14px;
  cursor: pointer;
}

#actionModal .danger {
  background: #ff4d4f;
  color: #fff;
}

#actionModal hr {
  border: none;
  height: 1px;
  background: #eee;
  margin: 12px 0;
}

/* ------- BRAND SUGGESTIONS -------*/
.brand-suggestions {
  position: absolute;
  width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-1);
  margin-top: 6px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 2000;
  display: none;
}

.brand-suggestions.open {
  display: block;
}

.brand-suggestions button {
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
}

.brand-suggestions button:hover {
  background: #f3effe;
}

.brand-suggestions img {
  width: 20px;
  height: 20px;
}

/* -------------- TOAST & NOTIFICATIONS ------------ */

#app-toast {
  position: fixed;
  top: 24px;
  right: 24px;

  min-width: 220px;
  max-width: 320px;

  padding: 12px 16px;
  border-radius: 14px;

  background: linear-gradient(135deg,
      rgba(40, 30, 80, 0.95),
      rgba(25, 20, 55, 0.95));

  color: #ffffff;
  font-size: 13.5px;
  font-weight: 500;

  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  /* animation start */
  opacity: 0;
  transform: translateX(120%) scale(0.95);
  pointer-events: none;

  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);

  z-index: 20000;
}

/* visible */
#app-toast.show {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

/* optional smooth exit */
#app-toast.hide {
  opacity: 0;
  transform: translateX(40%) scale(0.97);
}

.notification-panel {
  position: fixed;
  top: 72px;
  right: 16px;
  width: 320px;
  max-height: 70vh;
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 20px 40px rgba(120, 80, 200, 0.25),
    0 4px 12px rgba(0, 0, 0, 0.08);
  overflow-y: auto;
  z-index: 1001;
}

.notification-panel h4 {
  margin: 4px 4px 12px;
  font-size: 15px;
  font-weight: 600;
}

.notification-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: #faf9ff;
  margin-bottom: 8px;
  user-select: none;
}

.notification-item strong {
  display: block;
  font-size: 13px;
  color: #1f1b2e;
}

.notification-item p {
  font-size: 12px;
  margin: 4px 0;
  color: #5b5670;
}

.notification-item small {
  font-size: 11px;
  color: #9a95b5;
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.notif-header button {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: #7b4dff;
  cursor: pointer;
}

/* PROFILE PAGE */
/* profile */
.profile-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.profile-hero-avatar {
  width: 230px;
  height: 230px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-hero-avatar img {
  width: 150px;
  height: auto;
  border-radius: 10% 35%;
  border: 5px solid var(--secondary-blue);
}

.user-card {
  min-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 30px;
  background: var(--card-white);
  padding: 14px;
  border-radius: 24px;
  box-shadow: var(--shadow-1);
}

.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-name {
  font-weight: 700;
  font-size: 18px;
  color: var(--blaq);
}

.user-email {
  color: var(--text);
  margin-top: 6px;
  font-size: 13px;
}

.verified {
  background: var(--secondary-blue);
  color: white;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 12px;
  margin-left: 8px;
}

.security-summary {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--text);
}

.summary-item {
  flex: 1;
  background: #f8fbff;
  padding: 10px;
  border-radius: 10px;
  text-align: center;
}

.summary-value {
  font-weight: 700;
  color: var(--blaq);
  font-size: 18px;
}

.summary-label {
  font-size: 12px;
  color: var(--text);
  margin-top: 6px;
}

.security-note {
  color: var(--text);
  margin-top: 12px;
  font-size: 13px;
}

.edit-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text);
}

/* PROFILE PAGE MODALS */
#profileModal .modal-content {
  max-width: 420px;
}

.avatar-edit {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.avatar-edit img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #f1f1f1;
}

/* ================= PROFILE ACCOUNT MODAL ================= */

#accountModal {
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#accountModal.hidden {
  display: none;
}

.ui-card--account {
  width: 360px;
  max-width: 92%;
  background: #fff;
  border-radius: 24px;
  padding: 20px;
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.header-center {
  text-align: center;
  flex: 1;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.back-btn.hidden {
  visibility: hidden;
}

.account-avatar {
  position: relative;
  max-width: 96px;
  max-height: 96px;
  margin: 0 auto 12px;
  cursor: pointer;
}

.account-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid #1a73e8;
  box-shadow: var(--shadow-1);
}

.account-avatar::after {
  content: "✎";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 28px;
  height: 28px;
  background: var(--primary-blue);
  color: #fff;
  border-radius: 50%;
  border: 2px solid var(--card-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 5;
  pointer-events: none; 
}

.account-name {
  font-size: 16px;
  font-weight: 600;
  color: #385ed2;
}

.account-email {
  font-size: 13px;
  color: #5f6368;
  margin-top: 2px;
}

.modal-body {
  margin-top: 10px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-body button {
  padding: 10px;
  border-radius: 20px;
  border: 1px solid #dadce0;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}

.modal-body button:hover {
  background: #f1f3f4;
}

.btn-danger {
  color: #d93025;
}

.account-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
}

.account-item:hover {
  background: #f1f3f4;
}

.account-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.account-item small {
  font-size: 12px;
  color: #5f6368;
}

.modal-body input {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border-radius: 12px;
  border: 1px solid #ddd;
}


/* ================= AVATAR ACTION SHEET ================= */
#avatarSheet {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 5, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#avatarSheet .sheet {
  width: 100%;
  max-width: 420px;
  background: var(--card-white);
  border-radius: 22px;
  padding: 18px 18px 22px;
  box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.18);
  animation: sheetUp 0.35s ease;
}

#avatarSheet.hidden {
  opacity: 0;
  pointer-events: none;
}

#avatarSheet h4 {
  margin: 6px 0 16px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--blaq);
}

#avatarSheet button {
  width: 100%;
  height: 52px;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid var(--border-light);
  background: var(--bg-light);
  font-size: 15px;
  font-weight: 500;
  color: var(--blaq);
  cursor: pointer;
  transition: all 0.25s ease;
}

#avatarSheet button:hover {
  background: var(--primary-white);
  box-shadow: var(--shadow-1);
}

#avatarSheet .cancel {
  background: transparent;
  border: none;
  color: #d93025;
  font-weight: 500;
}

/* ================= CAMERA MODAL ================= */
#cameraModal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#cameraModal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.camera-box {
  width: 100%;
  max-width: 400px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  transform: scale(1);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#cameraModal.hidden .camera-box {
  transform: scale(0.95);
}

.camera-title {
  color: white;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 5px;
  opacity: 0.9;
}

.camera-box video {
  width: 100%;
  aspect-ratio: 3/4;
  /* Vertical Video Look */
  border-radius: 24px;
  object-fit: cover;
  background: #000;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.camera-actions {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  margin-top: 10px;
}

/* Button Styles */
.camera-btn-close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 20px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-btn-capture {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: white;
  border: 4px solid rgba(255, 255, 255, 0.3);
  background-clip: padding-box;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

/* CONFIRM MODAL layout */
#confirmModal {
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

#confirmModal.hidden {
  display: none;
}

#confirmModal .modal-content {
  width: 320px;
  max-width: 90%;
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  animation: modalScaleIn 0.18s ease-out;
}

#confirmModal h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #202124;
  text-align: center;
}

#confirmModal .modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

#confirmModal .modal-actions button {
  flex: 1;
  padding: 10px 0;
  border-radius: 18px;
  border: 1px solid #dadce0;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}

#confirmModal #confirmOk {
  background: #1a73e8;
  color: #fff;
  border-color: #1a73e8;
}

#confirmModal #confirmCancel {
  background: #f1f3f4;
}

/* MOBILE RESPONSIVE  */
@media (max-width: 768px) {
  .password-item {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    animation: none !important;
    background: var(--card-white) !important;
    color: var(--blaq) !important;
    box-shadow: var(--shadow-1) !important;

    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    margin-bottom: 12px !important;
  }

  .password-item h4,
  .password-title {
    color: var(--blaq) !important;
    font-weight: 600 !important;
  }

  .password-item p,
  .password-sub {
    color: var(--text) !important;
  }

  .password-item .btn-dots {
    color: var(--text) !important;
    opacity: 1 !important;
  }

  /* 5. Image Fix */
  .password-item img {
    opacity: 1 !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 8px !important;
    display: block !important;
  }
}

/* Notification Item Swipe  */
.notification-item {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  background: #faf9ff;
  border-radius: 12px;
  margin-bottom: 8px;
  transition: transform 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
}

/* Content padding wrapper */
.notif-content {
  padding: 10px 12px;
  pointer-events: none;
}

/* --- PWA Install Toast (Modern Glassmorphism) --- */
.pwa-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px); /* Start niche se */
    width: 90%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.9); /* Glass Effect */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-radius: 16px;
    padding: 16px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Jab active ho (Show) */
.pwa-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Hidden Class */
.pwa-toast.hidden {
    display: none;
}

/* Inner Layout */
.pwa-body {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pwa-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.pwa-text h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 700;
}

.pwa-text p {
    margin: 2px 0 0;
    font-size: 12px;
    color: #666;
}

/* Buttons */
.pwa-footer {
    display: flex;
    gap: 10px;
}

.btn-install {
    flex: 1;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
}

.btn-install:active {
    transform: scale(0.96);
}

.btn-secondary {
    flex: 1;
    background: #f0f0f0;
    color: #555;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-icon-secondary {
    background: #f0f0f0;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-icon-secondary:hover {
    background: #e0e0e0;
}

/* Footer layout fix */
.pwa-footer {
    display: flex;
    gap: 8px;
    align-items: center;
}
