/*
  TOFA7-AI: Crimson Obsidian Glassmorphism Design
  "أحمر في أسود كيرف زجاجي رايق ونار"
*/

:root {
  --bg-space: #070709;
  --bg-sidebar: #0b0b0f;
  --bg-card: rgba(18, 18, 25, 0.75);
  --bg-card-hover: rgba(28, 28, 38, 0.85);
  --bg-capsule: rgba(16, 16, 23, 0.85);
  --bg-user-msg: rgba(35, 15, 22, 0.7);
  --bg-ai-msg: rgba(14, 14, 20, 0.6);
  
  /* Crimson Fire Accents */
  --crimson-glow: #ff2a4b;
  --crimson-bright: #ff1744;
  --crimson-deep: #b00020;
  --crimson-subtle: rgba(255, 42, 75, 0.12);
  --crimson-border: rgba(255, 42, 75, 0.28);
  --crimson-border-hover: rgba(255, 42, 75, 0.55);
  --crimson-shadow: 0 0 25px rgba(255, 42, 75, 0.35);

  --border-glass: rgba(255, 255, 255, 0.08);
  --text-main: #f5f5f7;
  --text-secondary: #b5b5c0;
  --text-muted: #727282;

  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --radius-full: 9999px;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-width: 270px;
}

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

body.crimson-dark {
  font-family: var(--font-family);
  background-color: var(--bg-space);
  background-image: 
    radial-gradient(at 0% 0%, rgba(255, 42, 75, 0.07) 0px, transparent 55%),
    radial-gradient(at 100% 100%, rgba(176, 0, 32, 0.06) 0px, transparent 50%),
    radial-gradient(at 50% 10%, rgba(255, 23, 68, 0.04) 0px, transparent 60%);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  direction: rtl;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 42, 75, 0.2);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--crimson-glow);
}

/* Full App Layout */
.chatgpt-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* 1. SIDEBAR (زجاجي كيرف أحمر في أسود) */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-left: 1px solid var(--crimson-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), margin 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 50;
  backdrop-filter: blur(25px);
}

.sidebar.collapsed {
  margin-right: calc(-1 * var(--sidebar-width));
}

.sidebar-top {
  padding: 16px 14px;
}

.new-chat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255, 42, 75, 0.12), rgba(18, 18, 25, 0.8));
  color: var(--text-main);
  border: 1px solid var(--crimson-border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.new-chat-btn:hover {
  background: linear-gradient(135deg, rgba(255, 42, 75, 0.25), rgba(30, 30, 42, 0.9));
  border-color: var(--crimson-glow);
  box-shadow: 0 0 20px rgba(255, 42, 75, 0.3);
  transform: translateY(-1px);
}

/* Sidebar History */
.sidebar-history-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
}

.history-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  padding: 8px 10px 6px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.chats-list-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  position: relative;
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
}

.history-item .chat-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item:hover {
  background: rgba(255, 42, 75, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 42, 75, 0.15);
}

.history-item.active {
  background: rgba(255, 42, 75, 0.15);
  color: #fff;
  border-color: var(--crimson-border);
}

.delete-chat-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
}

.history-item:hover .delete-chat-btn {
  opacity: 1;
}

.delete-chat-btn:hover {
  color: var(--crimson-bright);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-btn:hover {
  background: rgba(255, 42, 75, 0.1);
  color: #fff;
  border-color: var(--crimson-border);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(18, 18, 25, 0.5);
  border: 1px solid var(--border-glass);
}

.avatar-circle-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--crimson-deep), #22050b);
  border: 1px solid var(--crimson-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 0 10px rgba(255, 42, 75, 0.3);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.user-plan {
  font-size: 0.72rem;
  color: var(--crimson-glow);
}

/* 2. CIRCULAR PREMIUM BUTTONS & BADGES */
.circle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(22, 22, 32, 0.7);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.circle-btn:hover {
  color: #fff;
  background: rgba(35, 35, 50, 0.85);
  border-color: var(--crimson-border);
  transform: scale(1.05);
}

.circle-btn-subtle {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

.circle-btn-subtle:hover {
  background: rgba(255, 42, 75, 0.12);
  color: var(--crimson-bright);
  border-color: var(--crimson-border);
}

.circle-btn-send {
  background: linear-gradient(135deg, var(--crimson-bright), var(--crimson-deep));
  color: #ffffff;
  border: none;
  box-shadow: 0 0 15px rgba(255, 42, 75, 0.4);
}

.circle-btn-send:hover {
  background: linear-gradient(135deg, #ff4767, var(--crimson-bright));
  box-shadow: 0 0 25px rgba(255, 42, 75, 0.6);
  transform: scale(1.08);
}

.icon-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 42, 75, 0.15);
  border: 1px solid var(--crimson-border);
  color: var(--crimson-bright);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-circle-sm {
  width: 22px;
  height: 22px;
}

/* 3. MAIN CHAT AREA */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Top Nav */
.top-nav {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(10, 10, 14, 0.8);
  backdrop-filter: blur(20px);
  z-index: 10;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.model-picker-wrapper {
  background: rgba(20, 20, 28, 0.6);
  border: 1px solid var(--crimson-border);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  transition: all 0.2s;
}

.model-picker-wrapper:hover {
  border-color: var(--crimson-glow);
  box-shadow: 0 0 15px rgba(255, 42, 75, 0.2);
}

.model-dropdown {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  padding: 6px 8px;
}

.model-dropdown option {
  background: #0f0f15;
  color: #fff;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-badge {
  font-size: 0.78rem;
  background: rgba(255, 42, 75, 0.12);
  color: var(--crimson-bright);
  border: 1px solid var(--crimson-border);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  background: var(--crimson-bright);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--crimson-bright);
  animation: pulseDot 2s infinite alternate;
}

@keyframes pulseDot {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.3); opacity: 1; }
}

/* Scroll Area */
.chat-scroll-area {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 10px;
  width: 100%;
}

/* Welcome Screen */
.welcome-screen {
  max-width: 820px;
  width: 100%;
  padding: 40px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: auto 0;
}

.welcome-logo-wrapper {
  position: relative;
  margin-bottom: 22px;
}

.welcome-glow-aura {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(255, 42, 75, 0.4) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulseAura 3s infinite alternate;
  pointer-events: none;
}

@keyframes pulseAura {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.5; }
  100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.9; }
}

.welcome-logo {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #1b0a0e, #0e0e14);
  border: 1px solid var(--crimson-glow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  position: relative;
  box-shadow: 0 0 25px rgba(255, 42, 75, 0.35);
}

.welcome-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.welcome-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 580px;
  line-height: 1.6;
  margin-bottom: 35px;
}

.prompt-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
}

@media (max-width: 680px) {
  .prompt-cards-grid {
    grid-template-columns: 1fr;
  }
}

.prompt-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: right;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-main);
  backdrop-filter: blur(20px);
}

.prompt-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--crimson-border-hover);
  box-shadow: 0 8px 25px rgba(255, 42, 75, 0.15);
  transform: translateY(-3px);
}

.card-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 42, 75, 0.1);
  border: 1px solid var(--crimson-border);
  color: var(--crimson-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.prompt-card:hover .card-icon-badge {
  background: var(--crimson-glow);
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 42, 75, 0.5);
}

.card-content {
  flex: 1;
}

.card-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.card-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* 4. MESSAGES LIST */
.messages-list {
  max-width: 840px;
  width: 100%;
  padding: 10px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.msg-row {
  display: flex;
  width: 100%;
  gap: 14px;
}

.msg-row.user {
  justify-content: flex-start; /* Right in RTL */
}

.msg-bubble-user {
  background: linear-gradient(135deg, rgba(255, 42, 75, 0.18), rgba(28, 14, 20, 0.7));
  border: 1px solid var(--crimson-border);
  color: var(--text-main);
  padding: 14px 20px;
  border-radius: 22px 4px 22px 22px;
  max-width: 80%;
  font-size: 0.98rem;
  line-height: 1.6;
  word-break: break-word;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.msg-row.assistant {
  justify-content: flex-start;
}

.assistant-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1b0a0e, #0e0e14);
  border: 1px solid var(--crimson-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(255, 42, 75, 0.25);
  margin-top: 4px;
}

.assistant-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.assistant-bubble {
  background: var(--bg-ai-msg);
  border: 1px solid var(--border-glass);
  border-radius: 4px 22px 22px 22px;
  padding: 18px 22px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-main);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.35);
}

.assistant-bubble p {
  margin-bottom: 12px;
}

.assistant-bubble strong {
  color: #fff;
}

/* Dedicated Action Box Beneath Every Message ("في مربع لي وحده") */
.response-action-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(18, 18, 25, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  margin-top: 10px;
  max-width: 320px;
  backdrop-filter: blur(15px);
}

.action-dock-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.action-dock-btn:hover {
  color: var(--crimson-bright);
  background: rgba(255, 42, 75, 0.1);
}

.dock-model-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Code Blocks */
.chat-code-block {
  background: #0b0b10;
  border: 1px solid var(--crimson-border);
  border-radius: var(--radius-md);
  margin: 14px 0;
  overflow: hidden;
  direction: ltr;
  text-align: left;
}

.code-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 42, 75, 0.08);
  border-bottom: 1px solid rgba(255, 42, 75, 0.15);
  padding: 8px 14px;
  font-size: 0.82rem;
  color: var(--crimson-glow);
  font-weight: 600;
}

.copy-code-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-code-btn:hover {
  background: var(--crimson-glow);
  color: #fff;
  border-color: var(--crimson-glow);
}

.chat-code-block pre {
  padding: 16px;
  overflow-x: auto;
  font-family: 'Consolas', 'Fira Code', monospace;
  font-size: 0.9rem;
  color: #f0f0f5;
  line-height: 1.5;
}

/* 5. BOTTOM INPUT CAPSULE (كيرف زجاجي أحمر في أسود) */
.input-container {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  background: linear-gradient(180deg, transparent, var(--bg-space) 40%);
  flex-shrink: 0;
  position: relative;
  z-index: 30;
}

.quick-chips-row {
  display: flex;
  gap: 8px;
  max-width: 820px;
  width: 100%;
  margin-bottom: 10px;
  overflow-x: auto;
  padding: 4px 0;
}

.quick-chip {
  background: rgba(18, 18, 25, 0.7);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}

.quick-chip:hover {
  background: rgba(255, 42, 75, 0.15);
  color: #fff;
  border-color: var(--crimson-border);
  transform: translateY(-2px);
}

/* Attachment Preview Box */
.attachment-preview-bar {
  max-width: 820px;
  width: 100%;
  margin-bottom: 8px;
}

.preview-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(25, 15, 20, 0.8);
  border: 1px solid var(--crimson-border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  backdrop-filter: blur(15px);
}

.preview-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--crimson-border);
}

.file-preview-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 0.88rem;
}

.remove-attachment-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.remove-attachment-btn:hover {
  background: var(--crimson-bright);
}

/* Capsule Box */
.input-capsule {
  max-width: 820px;
  width: 100%;
  background: var(--bg-capsule);
  border: 1px solid var(--crimson-border);
  border-radius: var(--radius-xl);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(25px);
  transition: all 0.25s ease;
}

.input-capsule:focus-within {
  border-color: var(--crimson-glow);
  box-shadow: 0 0 25px rgba(255, 42, 75, 0.25), 0 8px 32px rgba(0, 0, 0, 0.5);
}

.capsule-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  resize: none;
  min-height: 26px;
  max-height: 180px;
  outline: none;
  padding: 6px 0;
  line-height: 1.5;
}

.capsule-textarea::placeholder {
  color: var(--text-muted);
}

.capsule-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mic-btn.listening {
  color: #fff;
  background: var(--crimson-bright);
  box-shadow: 0 0 20px var(--crimson-bright);
  animation: pulseMic 1s infinite alternate;
}

@keyframes pulseMic {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}

.input-disclaimer {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 10px;
  text-align: center;
}

/* 6. MODALS */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background: #0f0f15;
  border: 1px solid var(--crimson-border);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 42, 75, 0.15);
}

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

.custom-key-input {
  width: 100%;
  background: #14141c;
  border: 1px solid var(--crimson-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-family: monospace;
  font-size: 0.95rem;
  outline: none;
  margin-bottom: 14px;
}

.custom-key-input:focus {
  border-color: var(--crimson-glow);
  box-shadow: 0 0 15px rgba(255, 42, 75, 0.3);
}

.action-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--crimson-bright), var(--crimson-deep));
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 15px rgba(255, 42, 75, 0.35);
}

.action-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(255, 42, 75, 0.5);
}

/* 7. GOOGLE AUTHENTICATION & PROFILE */
.nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.google-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: var(--radius-full);
  padding: 7px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  user-select: none;
}

.google-login-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.google-login-btn:active {
  transform: translateY(0);
}

.user-auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(22, 22, 32, 0.85);
  border: 1px solid var(--crimson-border);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  font-size: 0.86rem;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.user-avatar-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--crimson-glow);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.user-auth-name {
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signout-mini-btn {
  background: rgba(255, 42, 75, 0.15);
  border: 1px solid var(--crimson-border);
  color: #ff4767;
  cursor: pointer;
  font-size: 0.76rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  transition: all 0.2s;
  font-weight: 600;
}

.signout-mini-btn:hover {
  background: var(--crimson-glow);
  color: #fff;
}

/* Welcome Auth Banner */
.welcome-auth-banner {
  background: linear-gradient(135deg, rgba(30, 15, 22, 0.8), rgba(15, 15, 22, 0.9));
  border: 1px solid var(--crimson-border);
  border-radius: var(--radius-lg);
  padding: 16px 22px;
  max-width: 680px;
  width: 100%;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 42, 75, 0.1);
  backdrop-filter: blur(20px);
}

.auth-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: right;
}

.auth-badge-icon {
  font-size: 1.8rem;
}

.auth-banner-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.auth-banner-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.google-login-hero-btn {
  flex-shrink: 0;
  padding: 10px 20px;
  font-size: 0.92rem;
}

@media (max-width: 768px) {
  .welcome-auth-banner {
    flex-direction: column;
    text-align: center;
  }
  .auth-banner-content {
    flex-direction: column;
    text-align: center;
  }
  .nav-center {
    display: flex;
    gap: 6px;
  }
  .google-login-btn {
    padding: 6px 10px;
  }
  .google-login-btn span {
    display: none;
  }
  .mode-tab {
    padding: 4px 8px;
    font-size: 0.75rem;
  }
}

/* ========================================================
   8. ULTRA-FUTURISTIC AI IMAGE STUDIO & HOLOGRAPHIC SCANNER
   ======================================================== */

/* Mode Switch Tabs in Header */
.mode-switch-tabs {
  display: flex;
  background: rgba(14, 14, 20, 0.8);
  border: 1px solid var(--crimson-border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 4px;
}

.mode-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-tab:hover {
  color: #fff;
}

.mode-tab.active {
  background: linear-gradient(135deg, var(--crimson-bright), var(--crimson-deep));
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 42, 75, 0.45);
}

/* Studio Quick Presets Row */
.studio-presets-row {
  display: flex;
  gap: 8px;
  max-width: 820px;
  width: 100%;
  margin-bottom: 8px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
}

.studio-presets-row::-webkit-scrollbar {
  display: none;
}

.studio-preset-chip {
  background: rgba(25, 12, 18, 0.75);
  border: 1px solid rgba(255, 42, 75, 0.3);
  color: #ffd0d8;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
}

.studio-preset-chip:hover {
  background: linear-gradient(135deg, rgba(255, 42, 75, 0.25), rgba(176, 0, 32, 0.35));
  border-color: var(--crimson-glow);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 42, 75, 0.3);
}

/* HOLOGRAPHIC CYBER-SCANNER ANIMATION LOADER */
.cyber-image-loader {
  background: radial-gradient(circle at center, rgba(35, 10, 18, 0.7) 0%, rgba(10, 10, 15, 0.95) 80%);
  border: 1px solid var(--crimson-border);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), inset 0 0 30px rgba(255, 42, 75, 0.15);
  max-width: 440px;
  width: 100%;
}

/* Background Cyber Grid */
.cyber-image-loader::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(255, 42, 75, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 42, 75, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  opacity: 0.6;
}

/* Moving Laser Scan Beam */
.cyber-scan-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ff2a4b, #ffffff, #ff2a4b, transparent);
  box-shadow: 0 0 15px #ff2a4b, 0 0 30px rgba(255, 42, 75, 0.8);
  animation: laserScan 2.4s ease-in-out infinite alternate;
  z-index: 5;
}

@keyframes laserScan {
  0% { top: 5%; opacity: 0.3; }
  50% { opacity: 1; }
  100% { top: 95%; opacity: 0.3; }
}

/* Hologram Portal Rings */
.cyber-portal {
  width: 110px;
  height: 110px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.cyber-ring-outer {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px dashed rgba(255, 42, 75, 0.6);
  animation: rotateClockwise 6s linear infinite;
  box-shadow: 0 0 20px rgba(255, 42, 75, 0.3);
}

.cyber-ring-inner {
  position: absolute;
  width: 76%;
  height: 76%;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #ff1744;
  border-bottom-color: #ff1744;
  animation: rotateCounter 3s linear infinite;
}

.cyber-core-icon {
  font-size: 32px;
  animation: corePulse 1.8s ease-in-out infinite;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 15px #ff2a4b);
}

@keyframes rotateClockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes rotateCounter {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

@keyframes corePulse {
  0%, 100% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
}

.cyber-loader-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  text-shadow: 0 0 10px rgba(255, 42, 75, 0.5);
  position: relative;
  z-index: 2;
}

.cyber-loader-step {
  font-size: 0.84rem;
  color: #ff99aa;
  position: relative;
  z-index: 2;
  animation: stepGlow 1.5s infinite alternate;
}

@keyframes stepGlow {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

/* GENERATED & EDITED IMAGE CARD IN CHAT */
.ai-generated-image-card {
  background: rgba(18, 18, 25, 0.85);
  border: 1px solid var(--crimson-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin: 12px 0;
  max-width: 520px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5), 0 0 25px rgba(255, 42, 75, 0.15);
  backdrop-filter: blur(25px);
  animation: imageRevealGlow 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes imageRevealGlow {
  0% { transform: scale(0.95); opacity: 0; box-shadow: 0 0 50px rgba(255, 42, 75, 0.8); }
  100% { transform: scale(1); opacity: 1; box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5), 0 0 25px rgba(255, 42, 75, 0.15); }
}

.ai-image-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 42, 75, 0.3);
  cursor: pointer;
  background: #000;
}

.ai-image-wrap img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.ai-image-wrap:hover img {
  transform: scale(1.02);
}

.ai-image-zoom-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  gap: 8px;
}

.ai-image-wrap:hover .ai-image-zoom-overlay {
  opacity: 1;
}

.ai-image-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-glass);
  flex-wrap: wrap;
  gap: 8px;
}

.ai-image-btn-group {
  display: flex;
  gap: 8px;
}

.img-action-btn {
  background: rgba(30, 20, 25, 0.8);
  border: 1px solid var(--crimson-border);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.img-action-btn:hover {
  background: linear-gradient(135deg, var(--crimson-bright), var(--crimson-deep));
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 42, 75, 0.4);
  transform: translateY(-1px);
}

.img-model-badge {
  font-size: 0.74rem;
  color: var(--crimson-glow);
  background: rgba(255, 42, 75, 0.1);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 42, 75, 0.25);
}

/* FULLSCREEN LIGHTBOX MODAL */
.lightbox-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-modal.open {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 0 50px rgba(255, 42, 75, 0.4);
  border: 1px solid var(--crimson-border);
}

.lightbox-controls {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.lightbox-close-btn {
  position: absolute;
  top: -45px;
  right: -10px;
  background: rgba(255, 42, 75, 0.2);
  border: 1px solid var(--crimson-border);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s;
}

.lightbox-close-btn:hover {
  background: var(--crimson-bright);
}

/* ========================================================
   9. USER PROFILE DROPDOWN POPOVER & ACCOUNT SWITCHER
   ======================================================== */
.sidebar-footer {
  position: relative;
}

.user-dropdown-popover {
  position: absolute;
  bottom: 80px;
  right: 12px;
  left: 12px;
  background: rgba(14, 14, 20, 0.95);
  border: 1px solid var(--crimson-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.7), 0 0 25px rgba(255, 42, 75, 0.2);
  backdrop-filter: blur(25px);
  z-index: 100;
  animation: popoverFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
}

.user-dropdown-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dropdown-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-email {
  font-size: 0.76rem;
  color: var(--crimson-glow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-glass);
  margin: 8px 0;
}

.dropdown-item-btn {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: right;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.dropdown-item-btn:hover {
  background: rgba(255, 42, 75, 0.12);
  color: #fff;
}

.dropdown-item-btn.danger {
  color: #ff4767;
}

.dropdown-item-btn.danger:hover {
  background: rgba(255, 23, 68, 0.2);
  color: #ff1744;
}

/* ========================================================
   10. COMPLETE AUTH GATEWAY MODAL (GOOGLE, EMAIL, SMS OTP)
   ======================================================== */
.auth-modal-card {
  max-width: 480px;
  width: 100%;
}

.auth-modal-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 42, 75, 0.1);
  border: 1px solid var(--crimson-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-tabs {
  display: flex;
  background: #14141c;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 9px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: linear-gradient(135deg, var(--crimson-bright), var(--crimson-deep));
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 42, 75, 0.4);
}

.auth-full-google-btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-glass);
}

.auth-divider span {
  padding: 0 12px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.input-icon {
  position: absolute;
  right: 14px;
  font-size: 1.1rem;
  pointer-events: none;
}

.input-with-icon .custom-key-input {
  padding-right: 42px;
  margin-bottom: 0;
}

/* OTP 6-Digit Row */
.otp-notice {
  background: rgba(255, 42, 75, 0.1);
  border: 1px solid var(--crimson-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.otp-sent-icon {
  font-size: 1.6rem;
}

.otp-inputs-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 14px 0;
}

.otp-digit {
  width: 44px;
  height: 52px;
  background: #14141c;
  border: 1.5px solid var(--crimson-border);
  border-radius: 10px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  outline: none;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.otp-digit:focus {
  border-color: var(--crimson-glow);
  box-shadow: 0 0 15px rgba(255, 42, 75, 0.5);
  background: #1c1418;
}

.auth-link-btn {
  background: transparent;
  border: none;
  color: var(--crimson-glow);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px;
  text-decoration: underline;
  transition: color 0.2s;
}

.auth-link-btn:hover {
  color: #fff;
}

/* ========================================================
   11. REALTIME SMS / GMAIL INCOMING CODE ALERT TOAST
   ======================================================== */
.incoming-notice-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #1b0a10, #14141c);
  border: 1.5px solid var(--crimson-bright);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  display: none !important; /* Completely hidden by default */
  align-items: center;
  gap: 14px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 42, 75, 0.4);
  z-index: 99999;
  max-width: 480px;
  width: 90%;
}

.incoming-notice-toast.visible {
  display: flex !important;
  animation: toastDrop 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastDrop {
  from { top: -80px; opacity: 0; }
  to { top: 24px; opacity: 1; }
}

.notice-toast-icon {
  font-size: 1.8rem;
  animation: pulseCore 1.5s infinite;
}

.notice-toast-body {
  flex: 1;
}

.notice-sender {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ff99aa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.notice-text {
  font-size: 0.95rem;
  color: #fff;
  margin-top: 2px;
}

.notice-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
}

.notice-close-btn:hover {
  color: #fff;
}

/* ========================================================
   12. WEBSITE GENERATION INSTANT ZIP DOWNLOAD BOX
   ======================================================== */
.zip-download-box {
  background: linear-gradient(135deg, rgba(28, 12, 18, 0.85), rgba(16, 16, 24, 0.95));
  border: 1px solid var(--crimson-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin: 16px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 42, 75, 0.15);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: imageRevealGlow 0.5s ease-out;
}

.zip-box-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.zip-icon-glow {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 42, 75, 0.15);
  border: 1px solid var(--crimson-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 15px rgba(255, 42, 75, 0.3);
}

.zip-meta {
  flex: 1;
}

.zip-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.zip-files-list {
  font-size: 0.8rem;
  color: #ff99aa;
  margin-top: 2px;
  font-family: monospace;
}

.download-project-zip-btn {
  background: linear-gradient(135deg, var(--crimson-bright), #b00020);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(255, 42, 75, 0.4);
  transition: all 0.25s ease;
}

.download-project-zip-btn:hover {
  background: linear-gradient(135deg, #ff4767, var(--crimson-bright));
  box-shadow: 0 6px 30px rgba(255, 42, 75, 0.6);
  transform: translateY(-2px);
}



