:root {
  --white: #ffffff;
  --light-steel: #495057;
  --earth: #839788;
}

/* Base styles */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--white);
  color: var(--light-steel);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navigation Styles */
.nav {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(73, 80, 87, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

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

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--light-steel);
  font-weight: 700;
  font-size: 20px;
  transition: color 0.3s ease;
}

.brand-link:hover {
  color: var(--earth);
}

.brand-logo {
  width: 64px;
  height: 64px;
  margin-right: 20px;
  object-fit: contain;
  transition: transform 0.3s ease;
  background: transparent;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.brand-link:hover .brand-logo {
  transform: scale(1.1);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.brand-text {
  font-family: 'Inter', sans-serif;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-link {
  text-decoration: none;
  color: var(--light-steel);
  font-weight: 500;
  font-size: 16px;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--earth);
}

.nav-link.active {
  color: var(--earth);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--earth);
  border-radius: 1px;
}

/* Dropdown Styles */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(73, 80, 87, 0.08);
  border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 0;
  min-width: 320px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  margin-top: 20px;
}

.nav-dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-content::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid rgba(255, 255, 255, 0.85);
  filter: blur(0.5px);
}

.dropdown-body {
  padding: 28px;
}

.dropdown-body p {
  margin: 0;
  color: var(--light-steel);
  line-height: 1.7;
  font-size: 13px;
  text-align: left;
  font-weight: 400;
}

.nav-auth {
  display: flex;
  align-items: center;
}

.nav-auth-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
}

.btn-signin, .btn-signup {
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  display: inline-block;
}

.btn-signin {
  color: var(--light-steel);
  border: 1px solid rgba(73, 80, 87, 0.2);
  background: transparent;
}

.btn-signin:hover {
  color: var(--earth);
  border-color: var(--earth);
  background: rgba(131, 151, 136, 0.05);
}

.btn-signup {
  color: var(--white);
  background: var(--earth);
  border: 1px solid var(--earth);
}

.btn-signup:hover {
  background: #6b7f6a;
  border-color: #6b7f6a;
  transform: translateY(-1px);
}

.profile-section {
  display: flex;
  align-items: center;
  gap: 15px;
}

.welcome-text {
  color: var(--light-steel);
  font-size: 14px;
  font-weight: 500;
}

.profile-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--earth);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.profile-icon:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(131,151,136,0.3);
}

.desktop-logout-btn {
  background: #dc3545;
  color: var(--white);
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 15px;
}

.desktop-logout-btn:hover {
  background: #c82333;
  transform: translateY(-1px);
}

/* Bye Popup Styles */
.bye-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(73, 80, 87, 0.1);
  border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  padding: 0;
  z-index: 3000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.bye-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.bye-popup-content {
  padding: 32px;
  text-align: center;
  min-width: 280px;
}

.bye-icon {
  font-size: 48px;
  margin-bottom: 16px;
  animation: wave 1s ease-in-out infinite;
}

.bye-popup h3 {
  margin: 0 0 12px 0;
  color: var(--light-steel);
  font-size: 24px;
  font-weight: 600;
}

.bye-popup p {
  margin: 0;
  color: var(--light-steel);
  font-size: 16px;
  opacity: 0.8;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(20deg); }
  75% { transform: rotate(-20deg); }
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
}

.mobile-menu-toggle span {
  width: 20px;
  height: 2px;
  background: var(--light-steel);
  transition: all 0.3s ease;
  border-radius: 1px;
}

.mobile-menu-toggle:hover span {
  background: var(--earth);
}

/* Mobile Menu Styles */
.mobile-menu {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100vh;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  z-index: 2000;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.mobile-menu.open {
  left: 0;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(73, 80, 87, 0.1);
  background: rgba(255, 255, 255, 0.95);
  position: sticky;
  top: 0;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.mobile-brand-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--light-steel);
}

.mobile-menu-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--light-steel);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-close:hover {
  background: rgba(73, 80, 87, 0.1);
  color: var(--earth);
}

.mobile-nav {
  padding: 20px;
}

.mobile-nav-link {
  display: block;
  padding: 16px 0;
  color: var(--light-steel);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  border-bottom: 1px solid rgba(73, 80, 87, 0.1);
  transition: color 0.3s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--earth);
}

.mobile-nav-section {
  border-bottom: 1px solid rgba(73, 80, 87, 0.1);
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  cursor: pointer;
}

.mobile-nav-title {
  color: var(--light-steel);
  font-size: 16px;
  font-weight: 500;
}

.mobile-dropdown-toggle {
  background: none;
  border: none;
  color: var(--light-steel);
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
  transition: transform 0.3s ease;
}

.mobile-dropdown-toggle.active {
  transform: rotate(180deg);
}

.mobile-dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 16px;
}

.mobile-dropdown-content.active {
  max-height: 200px;
  padding: 16px;
}

.mobile-dropdown-content p {
  color: var(--light-steel);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  opacity: 0.8;
}

.mobile-auth-section {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(73, 80, 87, 0.1);
}

.mobile-btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  margin-bottom: 12px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.mobile-btn-primary {
  background: var(--earth);
  color: var(--white);
}

.mobile-btn-primary:hover,
.mobile-btn-primary.active {
  background: #6b7f6a;
}

.mobile-btn-secondary {
  background: rgba(73, 80, 87, 0.1);
  color: var(--light-steel);
  border: 1px solid rgba(73, 80, 87, 0.2);
}

.mobile-btn-secondary:hover {
  background: rgba(73, 80, 87, 0.15);
}

.mobile-btn-danger {
  background: #dc3545;
  color: var(--white);
}

.mobile-btn-danger:hover {
  background: #c82333;
}

.mobile-user-info {
  text-align: center;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(131, 151, 136, 0.1);
  border-radius: 8px;
  color: var(--light-steel);
  font-size: 14px;
}

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .nav-container {
    padding: 0 15px;
  }
  
  .brand-text {
    font-size: 18px;
  }
  
  .brand-icon {
    font-size: 20px;
  }
}

/* Container and Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 60px 0;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  color: var(--light-steel);
  margin: 0 0 20px 0;
  line-height: 1.2;
}

.hero p {
  font-size: 1.2rem;
  color: var(--light-steel);
  opacity: 0.8;
  margin: 0;
  line-height: 1.6;
}

.card {
  border: 1px solid rgba(73,80,87,0.12);
  border-radius: 14px;
  padding: 20px;
  margin: 18px 0;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.card h2 { margin-top: 0; color: var(--light-steel); }

.form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.form textarea, .form input[type="url"], .form input[type="email"], .form input[type="password"], .form input[type="text"] {
  width: 100%;
  font-size: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(73,80,87,0.2);
  border-radius: 12px;
  outline: none;
  color: var(--light-steel);
}
.form textarea { grid-column: 1 / -1; resize: vertical; }
.form input[type="email"], .form input[type="password"], .form input[type="text"] { grid-column: 1 / -1; }

.form button {
  background: var(--earth);
  color: var(--white);
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  grid-column: 1 / -1;
}
.form button:hover { filter: brightness(0.97); }

.result {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(131,151,136,0.08);
  border: 1px solid rgba(131,151,136,0.22);
  font-size: 14px;
  white-space: pre-wrap;
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(73,80,87,0.08);
  border: 1px solid rgba(73,80,87,0.18);
  margin-right: 8px;
  font-size: 12px;
}

/* Footer Styles */
.footer {
  background: rgba(73, 80, 87, 0.05);
  border-top: 1px solid rgba(73, 80, 87, 0.1);
  padding: 24px 0;
  text-align: center;
  width: 100%;
  position: relative;
  margin-top: auto;
  flex-shrink: 0;
  display: block; /* Default visible */
}

.footer-content {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-section {
  display: flex;
  align-items: center;
}

.footer-section span {
  color: var(--light-steel);
  font-size: 14px;
  opacity: 0.8;
}

.footer-link {
  color: var(--earth);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: #6b7f6a;
  text-decoration: underline;
}

.footer-copyright {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(73, 80, 87, 0.1);
}

.footer-copyright span {
  color: var(--light-steel);
  font-size: 13px;
  opacity: 0.7;
  font-weight: 500;
}

/* Authentication specific styles */
.auth-form .form {
  grid-template-columns: 1fr;
  gap: 16px;
}

.auth-link {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
}

.auth-link a {
  color: var(--earth);
  text-decoration: none;
  font-weight: 600;
}

.auth-link a:hover {
  text-decoration: underline;
}

/* Dashboard Styles */
#dashboard {
  margin-bottom: 40px;
  padding: 30px;
  background: rgba(131, 151, 136, 0.05);
  border: 1px solid rgba(131, 151, 136, 0.1);
  border-radius: 12px;
  flex-shrink: 0;
}

#dashboard h2 {
  margin: 0 0 20px 0;
  color: var(--light-steel);
  font-size: 1.5rem;
  font-weight: 600;
}

.scan-history {
  min-height: 100px;
}

.scan-item {
  background: var(--white);
  border: 1px solid rgba(73, 80, 87, 0.1);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.scan-item:hover {
  border-color: var(--earth);
  box-shadow: 0 2px 8px rgba(131, 151, 136, 0.1);
}

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

.scan-type {
  background: var(--earth);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.scan-time {
  color: var(--light-steel);
  font-size: 12px;
  opacity: 0.7;
}

.scan-content {
  color: var(--light-steel);
  font-size: 14px;
  word-break: break-all;
  line-height: 1.4;
}

/* User welcome styles */
#user-welcome {
  background: rgba(131,151,136,0.08);
  border: 1px solid rgba(131,151,136,0.22);
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0 40px 0;
  text-align: center;
}

#user-welcome p {
  margin: 0;
  font-weight: 600;
  color: var(--earth);
  font-size: 1.1rem;
}

#user-name {
  color: var(--light-steel);
}

/* Two-column layout for analysis sections */
.analysis-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 40px 0;
  width: 100%;
}

.analysis-container .card {
  margin: 0;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  .analysis-container {
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 30px 0;
  }
  
  .container {
    padding: 0 15px;
  }
}


