/* ==========================================================================
   MedPulse Doctor Portal - Design System & Custom CSS
   ========================================================================== */

:root {
  --bg-dark: #090e1a;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-border: rgba(255, 255, 255, 0.1);
  --bg-input: rgba(30, 41, 59, 0.7);
  --bg-input-focus: rgba(30, 41, 59, 0.95);
  
  --primary: #0d9488;
  --primary-light: #14b8a6;
  --primary-glow: rgba(13, 148, 136, 0.35);
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-purple: #8b5cf6;
  --danger: #ef4444;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --shadow-glow: 0 0 35px rgba(13, 148, 136, 0.25);
  --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Glow Effects */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

.bg-glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  top: -150px;
  left: -150px;
}

.bg-glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
  bottom: -200px;
  right: -200px;
}

.bg-glow-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-emerald) 0%, transparent 70%);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.app-container {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
}

/* View Sections */
.view-section {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.view-section.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   SIGN-IN VIEW STYLES
   ========================================================================== */

#auth-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card-wrapper {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  padding: 2.75rem 2.5rem;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  animation: fadeInCard 0.6s ease-out;
}

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

.brand-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-badge {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-cyan) 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 2.2rem;
  color: #fff;
  box-shadow: 0 10px 25px var(--primary-glow);
  animation: pulseLogo 3s infinite ease-in-out;
}

@keyframes pulseLogo {
  0%, 100% { transform: scale(1); box-shadow: 0 10px 25px var(--primary-glow); }
  50% { transform: scale(1.05); box-shadow: 0 15px 35px rgba(6, 182, 212, 0.45); }
}

.brand-header h1 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.brand-header .subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.auth-step {
  display: none;
}

.auth-step.active {
  display: block;
  animation: slideStep 0.3s ease-out;
}

@keyframes slideStep {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

.step-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  background: rgba(13, 148, 136, 0.15);
  border: 1px solid rgba(13, 148, 136, 0.3);
  color: var(--primary-light);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.auth-step h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.step-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

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

.form-group label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-with-prefix {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.input-with-prefix:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-input-focus);
}

.country-prefix {
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
  border-right: 1px solid var(--bg-card-border);
  user-select: none;
}

.input-with-prefix input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 1px;
}

/* Dev OTP Banner */
.dev-otp-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(13, 148, 136, 0.15));
  border: 1px dashed var(--accent-amber);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #fef08a;
}

.dev-otp-banner i {
  color: var(--accent-amber);
  font-size: 1rem;
}

.btn-copy-otp {
  background: var(--accent-amber);
  color: #000;
  border: none;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-copy-otp:hover {
  background: #fbbf24;
}

/* OTP Digits Input */
.otp-inputs-container {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.75rem;
}

.otp-digit {
  width: 100%;
  height: 58px;
  background: var(--bg-input);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-light);
  outline: none;
  transition: var(--transition);
}

.otp-digit:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.3);
  background: var(--bg-input-focus);
  transform: translateY(-2px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-cyan) 100%);
  color: #fff;
  box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(13, 148, 136, 0.45);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-emerald) 0%, var(--primary) 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(16, 185, 129, 0.45);
}

.btn-outline-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.825rem;
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-link:hover:not(:disabled) {
  color: var(--primary-light);
  text-decoration: underline;
}

.btn-link:disabled {
  color: var(--text-dim);
  cursor: not-allowed;
}

.otp-resend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.change-mobile-row {
  text-align: center;
  margin-top: 1rem;
}

.auth-footer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  font-size: 0.775rem;
  color: var(--text-dim);
}

/* ==========================================================================
   DOCTOR PROFILE PORTAL STYLES
   ========================================================================== */

#profile-view {
  padding-bottom: 5rem;
}

/* Top Navbar */
.portal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 2.5rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--bg-card-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-cyan) 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
}

.nav-title {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #fff 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
}

.status-indicator .dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-emerald);
}

.nav-profile-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.75rem 0.25rem 0.25rem;
  border-radius: 30px;
  border: 1px solid var(--bg-card-border);
}

.chip-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.chip-name {
  font-size: 0.875rem;
  font-weight: 600;
}

/* Profile Hero Card */
.profile-hero-card {
  max-width: 1280px;
  margin: 2rem auto 1.5rem;
  padding: 0 1.5rem;
}

.profile-hero-content {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  box-shadow: var(--shadow-card);
}

.avatar-container {
  position: relative;
}

.profile-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  box-shadow: 0 8px 20px var(--primary-glow);
}

.avatar-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  background: var(--accent-emerald);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  border: 2px solid var(--bg-dark);
}

.hero-details {
  flex: 1;
}

.hero-title-row {
  display: flex;
  align-items: center;
  gap: 1rem;

}

.hero-title-row h1 {
  font-size: 1.75rem;
  font-weight: 800;
}

.reg-tag {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--primary-light);
  font-weight: 600;
  margin-top: 0.1rem;
}

.hero-qual {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.hero-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-meta-tags span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-meta-tags i {
  color: var(--accent-cyan);
}

/* Stats Grid */
.stats-grid {
  max-width: 1280px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.2);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.icon-blue { background: rgba(13, 148, 136, 0.15); color: var(--primary-light); }
.icon-teal { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.icon-purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-info h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-top: 0.1rem;
}

/* Profile Form Content Grid */
.profile-content-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 992px) {
  .profile-content-grid {
    grid-template-columns: 1fr;
  }
  .profile-hero-content {
    flex-direction: column;
    text-align: center;
  }
  .hero-title-row {
    justify-content: center;
  }
  .hero-meta-tags {
    justify-content: center;
  }
}

.profile-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.card-header {
  padding: 1.25rem 1.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--bg-card-border);
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-main);
}

.card-header h3 i {
  color: var(--accent-cyan);
}

.card-body {
  padding: 1.75rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.col-6 {
  flex: 1;
}

.card-body input,
.card-body textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.925rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.card-body input:focus,
.card-body textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-input-focus);
}

.input-readonly {
  opacity: 0.7;
  cursor: not-allowed;
  background: rgba(15, 23, 42, 0.5) !important;
}

/* Floating Save Bar */
.save-bar {
  max-width: 1280px;
  margin: 2rem auto 0;
  padding: 1rem 2rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  position: sticky;
  bottom: 1.5rem;
  z-index: 90;
}

.save-bar span {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 300px;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary-light);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  animation: slideToast 0.3s ease-out;
}

.toast.toast-success { border-left-color: var(--accent-emerald); }
.toast.toast-danger { border-left-color: var(--danger); }
.toast.toast-info { border-left-color: var(--accent-cyan); }

@keyframes slideToast {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}
