/* Drawers & Overlay */
.bottom-drawer,
.submenu-drawer {
  position: fixed;
  bottom: -90vh;
  left: 0;
  width: 100%;
  height: 80vh;
  background-color: var(--white);
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
  transition: bottom var(--transition-speed) ease;
  z-index: 1100;
  overflow-y: auto;
}

.bottom-drawer.active,
.submenu-drawer.active {
  bottom: 0;
}

.submenu-drawer {
    z-index: 1150;
    display: none;
}
.submenu-drawer.active {
    display: block;
}

.drawer-handle {
  width: 40px;
  height: 5px;
  background-color: var(--border-color);
  border-radius: 3px;
  margin: 10px auto;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

.overlay.active {
  display: block;
}

/* Settings-specific styles */
.settings-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 15px 0;
}

.menu-section {
  padding-bottom: 20px;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}

a.menu-item {
  text-decoration: none;
}

.menu-item-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.menu-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  color: var(--text-color);
  font-size: 1.1rem;
}

.menu-item-icon i {
  color: var(--primary-color);
}

.menu-item-text {
  font-size: 1rem;
  color: var(--text-color);
}

.menu-item-right {
  color: var(--text-secondary);
}

.menu-section .menu-item:last-child {
  border-bottom: none;
}

/* Submenu (Account Drawer) */
.submenu-header {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
}

.back-button {
  background: none;
  border: none;
  cursor: pointer;
  margin-right: 15px;
  font-size: 1.1rem;
}

.back-button i {
  color: var(--primary-color);
}

.submenu-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.submenu-content {
  padding: 20px;
}

/* Profile Section Styles */
.profile-section { margin-bottom: 1rem; }
.profile-header { border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 1.5rem; }
.profile-info { display: flex; align-items: center; gap: 1rem; padding-bottom: 1rem; }
.profile-avatar { width: 50px; height: 50px; border-radius: 50%; background-color: var(--primary-color); color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; font-weight: 600; flex-shrink: 0; }
.profile-name { font-size: 1.1rem; font-weight: 600; }
.profile-email { font-size: 0.9rem; color: var(--text-secondary); }
.profile-stats { display: flex; justify-content: space-around; padding-top: 1rem; border-top: 1px solid var(--border-color); }
.stat-item { text-align: center; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.25rem; }
.stat-value { font-size: 1.1rem; font-weight: 600; }

/* --- Auth & Google Styles (Polished) --- */

.auth-options {
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.auth-header-title {
    text-align: center;
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Google Button - Identity Compliant */
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    background-color: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    color: #3c4043;
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
}

.google-btn:hover {
    background-color: #f7fafe;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.30), 0 1px 3px 1px rgba(60,64,67,0.15);
    border-color: #d2e3fc;
}

.google-btn:active {
    background-color: #f1f3f4;
}

.google-btn svg {
    margin-right: 12px;
    height: 18px;
    width: 18px;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.25rem 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
}

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

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

/* Compact Form Styles */
.auth-form .form-group {
    margin-bottom: 0.85rem; /* Reduced margin */
}

.auth-form .form-input {
    padding: 10px 12px; /* Slightly tighter padding */
}

.form-submit {
    margin-top: 0.5rem;
    width: 100%;
}

.form-footer {
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Legal Links */
.legal-links-footer {
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
    margin-top: auto; /* Pushes to bottom if space permits */
}

/* Desktop Overrides for "One Screen" fit */
@media (min-width: 768px) {
  .drawer-handle { display: none !important; }
  
  .bottom-drawer,
  .submenu-drawer {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 420px !important; /* Slightly wider for better auth layout */
    height: auto !important;
    max-height: 90vh !important; /* Allow it to fit on screen */
    border-radius: 12px !important;
    bottom: auto !important;
    opacity: 0;
    display: none;
    box-shadow: 0 24px 38px 3px rgba(0,0,0,0.14), 0 9px 46px 8px rgba(0,0,0,0.12);
  }
  
  .bottom-drawer.active,
  .submenu-drawer.active {
    opacity: 1 !important;
    display: block !important;
    bottom: auto !important;
  }

  .auth-options {
      padding: 2rem; /* More breathing room on desktop */
  }
}
