:root {
  /* Professional Palette: Deep Sky Blue (Sky-800) & Cool Gray */
  --brand-color: #0d1117; /* Deep Sky Blue for brand/accents (Sky-800) */
  --primary-color: #075985; /* Deep Sky Blue for primary actions */
  --highlight-color: #0ea5e9; /* Medium Sky Blue for subtle highlights/hover (Sky-500) */
  --sidebar-width: 240px;
  --sidebar-bg: #ffffff;
  --sidebar-border: #e5e7eb;
  --bg-light: #f9fafb;
}

/* Base Layout and Typography */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden; 
  min-width: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-light);
  color: #1f2937; /* Dark Slate Gray */
  min-width: 0;
}

/* ------------------------------------------------------------------ */
/* --- DEFAULT MOBILE/SMALL SCREEN STYLES (Applies to all) --- */
/* ------------------------------------------------------------------ */

/* --- Topbar --- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px; 
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Keep right padding, set left padding to 0 */
  padding: 0 0.5rem 0 0; 
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.left-section {
  display: flex;
  align-items: center;
  /* Add padding-left back to left-section on mobile */
  padding-left: 0.5rem; 
  gap: 0.25rem; 
}

.topbar .burger {
  background: none;
  border: none;
  cursor: pointer;
  
  display: flex; 
  align-items: center; 
  justify-content: center;
  
  padding: 0.5rem; 
  border-radius: 4px;
}
.topbar .burger:hover {
    background: #f3f4f6;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.25rem; 
  font-weight: 700;
  color: var(--brand-color);
}

/* Brand Text is smaller on mobile (since it's visible) */
.topbar .brand-text {
  font-size: 0.875rem; 
}

.logo {
  width: 24px;
  height: 24px;
}

.user-info {
  display: flex;
  align-items: center; 
  gap: 0.25rem; 
  font-size: 0.75rem; 
  color: #4b5563;
  max-width: 50%; 
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-info #userEmail {
    display: none; 
}

#userName {
    max-width: 80px; 
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-btn {
  display: none; 
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - 60px);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  transform: translateX(-100%); 
  transition: transform 0.3s ease-in-out; 
  overflow-y: auto;
  z-index: 1000; 
  box-shadow: none;
}

.sidebar.open-mobile {
  transform: translateX(0); 
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
}

.menu {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.25rem;
}

.menu-btn {
  display: flex; 
  align-items: center;
  gap: 0.5rem;
  
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.15rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  color: #374151;
  transition: background 0.2s, color 0.2s;
  font-weight: 500;
}

.menu-btn:hover {
  background: #f3f4f6;
  color: var(--brand-color);
}

.menu-btn.active {
  background: #f0f9ff; 
  color: var(--primary-color);
  font-weight: 600;
}

/* --- Content --- */
.content {
  margin-top: 60px;
  margin-left: 0; 
  padding: 1rem; 
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  min-width: 0; 
}

/* 🚨 FIX: Mobile Zoom Issue (Inputs) */
/* Style for all form inputs and buttons inside the main content */
.content input[type="text"],
.content input[type="email"],
.content input[type="password"],
.content input[type="time"],
.content textarea,
.content .px-4.py-2, 
.content .px-6.py-2 {
    padding: 0.5rem 0.75rem !important; 
    /* Changed from 0.875rem to 1rem (16px) to prevent mobile browser zoom on focus */
    font-size: 1rem !important; 
}

/* Dashboard Layout (Mobile: Stack Vertically) */
#dashboard .flex.gap-6.items-start {
    flex-direction: column; 
    gap: 1rem; 
}
#dashboard .w-80.flex-shrink-0,
#dashboard .max-w-xl.flex-shrink-0 {
    width: 100%;
    max-width: none;
}
#dashboard .flex-wrap {
    justify-content: flex-start; 
}

/* --- General Components --- */
.card {
  padding: 1rem; 
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
}

.wrapper {
  display: none;
}

.wrapper.active {
  display: block;
}

/* ------------------------------------------------------------------ */
/* --- MEDIA QUERY: TABLET/DESKTOP VIEW (Screens 768px wide and UP) --- */
/* ------------------------------------------------------------------ */
@media (min-width: 768px) {
    
    /* --- Topbar --- */
    .topbar {
        /* Increase right padding, keep left padding at 0 */
        padding: 0 2rem 0 0; 
    }
    
    .left-section {
        /* Reverting to the calculated value for perfect desktop alignment (4px) */
        padding-left: 0.99rem; 
        /* Add gap/padding between the burger button and the brand name */
        gap: 0.75rem; 
    }

    .topbar .burger {
      /* Add right padding to the burger button itself to create space next to it */
      padding-right: 0.75rem; 
    }
    
    .topbar .brand {
        gap: 0.6rem;
        font-size: 1.125rem;
    }
    /* RESTORE: Brand Text desktop size */
    .topbar .brand-text {
        font-size: 1.125rem;
    }

    .logo {
        width: 32px;
        height: 32px;
    }
    
    /* RESTORE: Desktop User Info */
    .user-info {
        gap: 0.75rem;
        font-size: 0.9rem;
        max-width: none;
        overflow: visible;
        white-space: normal;
    }
    .user-info #userEmail {
        display: inline; 
    }
    #userName {
        max-width: none;
    }
    
    /* RESTORE: Form Inputs and Buttons on desktop */
    .content input[type="text"],
    .content input[type="email"],
    .content input[type="password"],
    .content input[type="time"],
    .content textarea,
    .content .px-4.py-2, 
    .content .px-6.py-2 {
        padding: 0.75rem 1rem !important; 
        font-size: 1rem !important; /* Kept at 1rem for consistency and zoom prevention */
    }

    /* --- Sidebar --- */
    .sidebar {
        position: fixed;
        width: var(--sidebar-width);
        transform: translateX(0);
        box-shadow: none;
        z-index: 999; 
    }
    
    .sidebar.collapsed {
      width: 72px;
    }
    
    /* --- Content --- */
    .content {
        margin-left: var(--sidebar-width);
        padding: 2rem; 
    }
    
    .content.collapsed {
      margin-left: 72px;
    }

    /* --- Dashboard Layout (Desktop: Side-by-Side) */
    #dashboard .flex.gap-6.items-start {
        flex-direction: row;
        gap: 1.5rem;
    }
    #dashboard .w-80.flex-shrink-0 {
        width: 320px; 
        flex-shrink: 0;
    }
    #dashboard .max-w-xl.flex-shrink-0 {
        width: auto;
        max-width: 48rem;
    }

    /* --- Profile Layout (Desktop: Two Columns) */
    #profile .grid.md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    /* --- Subscription Layout (Desktop: Two Columns) */
    /* #subscription #plan-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    } */
    
    /* --- Menu Button text is visible on full width sidebar --- */
    .sidebar .text {
        display: inline;
    }
    /* ... but hidden when collapsed */
    .sidebar.collapsed .text {
        display: none;
    }
    .sidebar.collapsed .menu-btn {
      justify-content: center;
      padding: 0.75rem;
    }
}

/* css/main.css */
/* Add this class to your main CSS file */

.step-hidden {
    /* Hides the content visually and collapsing its height */
    height: 0;
    overflow: hidden;
    
    /* Ensures no vertical margin/padding interference */
    margin-top: 0 !important; 
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;

    /* Makes sure it cannot be interacted with until shown */
    visibility: hidden;
    opacity: 0;
    transition: height 0.3s ease-out, opacity 0.3s ease-out;
}

.step-visible {
    /* The JS will apply this class to reveal the step */
    height: auto;
    visibility: visible;
    opacity: 1;
}

/* Custom styles merged from complete_subscription.html for plan selection */
.plan-card {
    transition: all 0.3s ease-in-out; /* Add transition for smoothness */
    border: 1px solid transparent; /* Base border for consistent layout */
}

.plan-card-selected {
  /* Adjusted highlight: Thin border (2px or 1px from the image) and minimal shadow */
  border-color: rgb(7, 89, 133); /* sky-800 */
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* Regular shadow */
  transform: scale(1.005); /* Very slight lift */
  position: relative;
  z-index: 10;
}

/* Style for the button inside the selected card (REMOVED/OBSOLETE but kept for reference) */
.plan-card-selected[data-plan="Free"] .plan-select-btn {
  background-color: rgb(7, 89, 133); /* sky-800 */
  color: white;
  border: none;
}

/* Style for the 'Pro' card button highlight (REMOVED/OBSOLETE but kept for reference) */
.plan-card-selected:not([data-plan="Free"]) .plan-select-btn {
  background-color: rgb(7, 89, 133); /* sky-800 */
  color: white;
  border: none;
}

/* Keep the Pro card visual lift but apply it to the general card for better handling */
.plan-card-pro-base {
    transform: scale(1.02); /* Slight lift for Pro card */
    border: 1px solid transparent; /* Ensure border is consistent */
}

/* Highlighted Pro card */
.plan-card-selected[data-plan="Pro"] {
    border-color: rgb(7, 89, 133);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: scale(1.02); /* Maintain the Pro lift */
}

/* Styling the Choose Plan button to match the original image's look when not selected (REMOVED/OBSOLETE but kept for reference) */
.plan-select-btn {
    border: 1px solid rgb(209, 213, 219); /* border-gray-300 */
    background-color: white;
    color: rgb(51, 65, 85); /* slate-700 */
    transition: all 0.3s ease;
}

/* Add/Replace this animation block in your css/main.css */

@keyframes buzz-shake {
  /* Slightly pronounced shake for better visibility on a trigger */
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* This class will be added by JavaScript to trigger the animation once */
.trigger-buzz {
  animation: buzz-shake 0.4s ease-in-out;
}

/* Ensure no default hover styles trigger the animation */
#complete-subscription-btn:hover {
  animation: none; /* Explicitly prevent the hover effect if any remains */
}

.hidden-by-default {
    /* Hide the entire page content */
    opacity: 0;
    /* Optional: Show a simple spinner/loading message here if desired */
}