/* ============================================================================
   MelodyMap Dashboard Styles
   Unified CSS for dashboard.qmd and pro.qmd pages
   Using actual MelodyMap brand colors from mmio.css
   ============================================================================ */

/* ============================================================================
   ESSENTIAL UTILITY CLASSES
   ============================================================================ */

/* Hidden class - CRITICAL for show/hide functionality */
.hidden {
  display: none !important;
}

/* ============================================================================
   BRAND COLORS & VARIABLES - Matching mmio.css
   ============================================================================ */
:root {
  --mm-navy: #203A59;           /* Your actual navy from mmio.css */
  --mm-navy-dark: #162840;      /* Darker variant */
  --mm-orange: #FF8862;         /* Your actual orange/CTA color */
  --mm-orange-dark: #e07552;    /* Orange hover state from mmio.css */
  --mm-brand: #113cfc;          /* Your brand blue from mmio.css */
  --mm-ink: #0b2545;            /* Dark text from mmio.css */
  --mm-muted: #5f6b7a;          /* Muted gray text from mmio.css */
  --mm-gray-light: #f8f9fa;
  --mm-gray-border: #e5e7eb;
  --mm-font-primary: 'Roboto', ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* ============================================================================
   BASE STYLES
   ============================================================================ */

body {
  font-family: var(--mm-font-primary);
  color: var(--mm-ink);
  line-height: 1.6;
  background: white;
}

/* ============================================================================
   CONTAINER LAYOUTS
   ============================================================================ */

.dashboard-container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Row layout for headers with actions */
.button-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--mm-gray-border);
}

.action-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ============================================================================
   TYPOGRAPHY - Using MelodyMap colors
   ============================================================================ */

h1, h2, h3, h4 {
  font-family: var(--mm-font-primary);
  color: var(--mm-navy);
}

h1 {
  font-size: 2rem;
  text-align: center;
  color: var(--mm-navy);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.75rem;
  color: var(--mm-navy) !important;
  margin: 0;
}

h3 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: var(--mm-navy);
}

/* ============================================================================
   BUTTONS - Using MelodyMap orange like navbar
   ============================================================================ */

button,
.btn,
a[role="button"] {
  font-family: var(--mm-font-primary) !important;
  font-size: 14pt !important;
  padding: 0.5rem 1rem !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  border: none !important;
  display: inline-block;
}

/* Primary button styles - matching navbar button */
#logout-btn,
#access-biz-btn,
#upgrade-btn,
button[type="submit"] {
  background: var(--mm-orange) !important;
  color: white !important;
  border: none !important;
  font-weight: 600;
}

#logout-btn:hover,
#access-biz-btn:hover,
#upgrade-btn:hover,
button[type="submit"]:hover {
  background: var(--mm-orange-dark) !important;
  color: white !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 8px rgba(224, 117, 82, 0.3) !important;
}

/* Disabled button state */
button:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* ============================================================================
   FORMS
   ============================================================================ */

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
select,
textarea {
  font-family: var(--mm-font-primary);
  font-size: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--mm-gray-border);
  border-radius: 8px;
  width: 100%;
  transition: border-color 0.2s ease;
  background: #f9fafb;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--mm-brand) !important;
  box-shadow: 0 0 0 3px rgba(17, 60, 252, 0.15);
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--mm-ink);
}

small {
  display: block;
  margin-top: 0.25rem;
  color: var(--mm-muted);
  font-size: 0.875rem;
}

/* ============================================================================
   LOGIN VIEW STYLES
   ============================================================================ */

#login-view {
  max-width: 500px;
  margin: 3rem auto;
  padding: 2rem;
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(11, 37, 69, 0.08);
}

#login-view h1 {
  color: var(--mm-navy);
  text-align: center;
  margin-bottom: 2rem;
}

/* ============================================================================
   FIREBASEUI CUSTOMIZATION - Match MelodyMap theme
   ============================================================================ */

.firebaseui-idp-button {
  background-color: var(--mm-orange) !important;
  color: white !important;
  border: none !important;
  font-family: var(--mm-font-primary) !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
}

.firebaseui-idp-button:hover {
  background-color: var(--mm-orange-dark) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 8px rgba(224, 117, 82, 0.3) !important;
}

.firebaseui-input {
  font-family: var(--mm-font-primary) !important;
  border-radius: 8px !important;
  background: #f9fafb !important;
}

.firebaseui-input:focus {
  border-color: var(--mm-brand) !important;
  box-shadow: 0 0 0 3px rgba(17, 60, 252, 0.15) !important;
}

/* ============================================================================
   DASHBOARD SECTIONS
   ============================================================================ */

#user-welcome {
  font-size: 1.1rem;
  margin: 1rem 0;
  padding: 1rem;
  background-color: var(--mm-gray-light);
  border-left: 4px solid var(--mm-navy);
  border-radius: 8px;
  color: var(--mm-ink);
}

#free-section,
#pro-section {
  margin-top: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   STATUS MESSAGES
   ============================================================================ */

#save-status,
#error-message {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  font-weight: bold;
}

.success-message,
span[style*="color: green"] {
  color: #155724;
}

.error-message,
span[style*="color: red"] {
  color: #721c24;
}

/* ============================================================================
   LOADING STATE
   ============================================================================ */

#loading {
  text-align: center;
  padding: 3rem;
  color: var(--mm-muted);
  font-size: 1.1rem;
}

#loading::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 10px;
  border: 3px solid var(--mm-gray-border);
  border-top-color: var(--mm-brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================================
   PRO PAGE SPECIFIC
   ============================================================================ */

#not-pro > div {
  background-color: #fff3cd;
  border: 1px solid #0b2545;
  color: #856404;
}

#pro-content form {
  background-color: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}



/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--mm-brand);
  outline-offset: 2px;
}

/* Skip to content link */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}




/* ============================================================================
   FORM STYLES - Shared by Pro and Plus pages
   ============================================================================ */

.business-form {
  max-width: 800px;
  margin: 0 auto;
}

.form-section {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-section h3 {
  color: #FF8862;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f0f0f0;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #FF8862;
  box-shadow: 0 0 0 2px rgba(255,136,98,0.1);
}

.form-group small {
  display: block;
  margin-top: 0.25rem;
  color: #666;
  font-size: 0.875rem;
}

/* Form row for side-by-side fields */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Form actions */
.form-actions {
  text-align: center;
  padding: 2rem;
}

.form-actions button {
  min-width: 150px;
}

/* Status message */
#save-status {
  margin-top: 1rem;
  font-weight: 600;
  min-height: 1.5rem;
}

/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.page-header h1 {
  color: #001a3d;
  margin: 0;
}

/* Warning box for access denied */
.warning-box {
  max-width: 500px;
  margin: 3rem auto;
  padding: 2rem;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  text-align: center;
}

.warning-box h2 {
  color: #856404;
  margin-bottom: 1rem;
}

/* Loading state */
.loading-state {
  text-align: center;
  padding: 3rem;
  color: #666;
}



/* Profile Navigation Link Styles */
.profile-link {
  display: inline-block;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none !important;
}

.profile-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  opacity: 0.9;
}

/* Ensure proper spacing in action row */
.action-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

  
/*  --------       MOBILE  --------  */

/* Critical CSS for mobile */
#login-view:not(.hidden) {
    display: block !important;
  }
  
#firebaseui-auth-container {
    min-height: 200px; /* Ensure container has space */
  }
  
  
  
  

/* Mobile responsiveness */
@media (max-width: 768px) {
  .button-row {
    flex-direction: column;
    gap: 1rem;
  }
  
  .action-row {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .profile-link {
    margin-bottom: 0.5rem;
    width: 100%;
    text-align: center;
  }
}

/* Mobile-specific fixes */
@media (max-width: 768px) {
    #login-view {
      padding: 1rem;
      margin: 1rem;
    }
    
    .firebaseui-container {
      max-width: 100%;
    }
  }

/* Responsive */
@media (max-width: 768px) {
  .form-section {
    padding: 1rem;
  }
  
  .page-header {
    flex-direction: column;
    gap: 1rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
}
  
/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
  .button-row,
  #logout-btn,
  #access-biz-btn,
  #upgrade-btn,
  button[type="submit"] {
    display: none !important;
  }
}
/* High contrast mode support */
@media (prefers-contrast: high) {
  button,
  .btn {
    border-width: 2px !important;
    border: 2px solid currentColor !important;
  }
}
    
/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
  .dashboard-container {
    margin: 1rem;
    padding: 0 0.5rem;
  }
  
  .button-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .action-row {
    flex-direction: column;
    width: 100%;
  }
  
  #logout-btn,
  #access-biz-btn,
  #upgrade-btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 1.25rem;
  }
  
  #pro-form {
    padding: 1rem !important;
  }
}



/*  --------       MOBILE  --------  */

/* Critical CSS for mobile */
#login-view:not(.hidden) {
  display: block !important;
}

#firebaseui-auth-container {
  min-height: 200px; /* Ensure container has space */
}

/* ============================================================================
   RESPONSIVE (Consolidated <= 768px breakpoint)
   ============================================================================ */
@media (max-width: 768px) {

  /* --- Layout rows & links --- */
  .button-row {
    flex-direction: column;
    gap: 1rem;
    /* From later block: ensure stretch behavior is retained */
    align-items: stretch;
  }

  .action-row {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    /* From later block: ensure column stacking on narrow screens */
    flex-direction: column;
  }

  .profile-link {
    margin-bottom: 0.5rem;
    width: 100%;
    text-align: center;
  }

  /* --- Auth view --- */
  #login-view {
    padding: 1rem;
    margin: 1rem;
  }

  .firebaseui-container {
    max-width: 100%;
  }

  /* --- Forms & page sections --- */
  .form-section {
    padding: 1rem;
  }

  .page-header {
    flex-direction: column;
    gap: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* --- Dashboard container & buttons --- */
  .dashboard-container {
    margin: 1rem;
    padding: 0 0.5rem;
  }

  #logout-btn,
  #access-biz-btn,
  #upgrade-btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  /* --- Typography tweaks --- */
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  /* --- Pro form padding --- */
  #pro-form {
    padding: 1rem !important;
  }
}


.hidden {
  display: none !important;
}

/* Form focus styles */
input:focus, textarea:focus {
  outline: none;
  border-color: #FF8862 !important;
  box-shadow: 0 0 0 2px rgba(255, 136, 98, 0.1);
}

/* Button hover effects */
button[type="submit"]:hover {
  background-color: #001a3d !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#logout-btn:hover{
  background-color: #5a6268 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}


/* ════════════════════════════════════════════════════════════════
   PROFILE FORM STYLES
   All form styling in one place - no inline styles!
   ════════════════════════════════════════════════════════════════ */

/* Form Container */
.profile-form {
  max-width: 600px;
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Form Title */
.form-title {
  margin-bottom: 1.5rem;
  color: #FF8862;
  font-size: 1.5rem;
}

/* Form Fields */
.form-field {
  margin-bottom: 1.5rem;
}

/* Labels */
.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
  color: #333;
}

/* Required field indicator */
.form-label.required::after {
  content: ' *';
  color: red;
}

/* Input Fields */
.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #FF8862;
  box-shadow: 0 0 0 3px rgba(255, 136, 98, 0.1);
}

/* Textarea specific */
.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Help Text */
.form-help {
  display: block;
  margin-top: 0.25rem;
  color: #666;
  font-size: 0.85rem;
}

/* Links in Help Text */
.form-link {
  color: #FF8862;
  text-decoration: underline;
}

.form-link:hover {
  color: #001a3d;
}

/* ════════════════════════════════════════════════════════════════
   LOCATION SECTION
   ════════════════════════════════════════════════════════════════ */

.location-section {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
  border-left: 4px solid #FF8862;
}

.section-title {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #FF8862;
  font-size: 1.1rem;
}

.section-description {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════════
   LOCATION STATUS DISPLAY
   ════════════════════════════════════════════════════════════════ */

.location-status {
  display: none;
  padding: 0.75rem;
  border-radius: 4px;
  margin-top: 1rem;
  font-size: 0.9rem;
  animation: fadeIn 0.3s ease-in;
}

.location-status.show {
  display: block;
}

/* Status variants */
.location-status.info {
  background-color: rgba(33, 150, 243, 0.1);
  border-left: 4px solid #2196F3;
  color: #1976D2;
}

.location-status.success {
  background-color: rgba(76, 175, 80, 0.1);
  border-left: 4px solid #4CAF50;
  color: #388E3C;
}

.location-status.error {
  background-color: rgba(244, 67, 54, 0.1);
  border-left: 4px solid #f44336;
  color: #D32F2F;
}

.location-status.warning {
  background-color: rgba(255, 152, 0, 0.1);
  border-left: 4px solid #ff9800;
  color: #F57C00;
}

/* ════════════════════════════════════════════════════════════════
   SUBMIT BUTTON
   ════════════════════════════════════════════════════════════════ */

.btn-submit {
  background-color: #FF8862;
  color: #ffffff;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-submit:hover {
  background-color: #001a3d;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

/* ════════════════════════════════════════════════════════════════
   SAVE STATUS MESSAGE
   ════════════════════════════════════════════════════════════════ */

.save-status {
  margin-top: 1.5rem;
  font-weight: bold;
}

/* ════════════════════════════════════════════════════════════════
   ANIMATIONS
   ════════════════════════════════════════════════════════════════ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .profile-form {
    padding: 1.5rem;
  }
  
  .location-section {
    padding: 1rem;
  }
}



/* ============================================================================
   PRINT STYLES
   ============================================================================ */
@media print {
  .button-row,
  #logout-btn,
  #access-biz-btn,
  #upgrade-btn,
  button[type="submit"] {
    display: none !important;
  }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */
/* High contrast mode support */
@media (prefers-contrast: high) {
  button,
  .btn {
    border-width: 2px !important;
    border: 2px solid currentColor !important;
  }
}
  


/* Place ID Finder Widget Styles */
.place-finder-widget {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.place-finder-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #212529;
}

.place-finder-description {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.btn-place-search {
  width: 100%;
  padding: 0.875rem 1rem;
  background: #113cfc;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(17, 60, 252, 0.1);
}

.btn-place-search:hover {
  background: #0d2ebf;
  box-shadow: 0 4px 8px rgba(17, 60, 252, 0.2);
  transform: translateY(-1px);
}

.btn-place-search:disabled {
  background: #adb5bd;
  cursor: not-allowed;
}

.place-search-results {
  margin-top: 1rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: white;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.place-result-card {
  padding: 1rem;
  border-bottom: 1px solid #f1f3f5;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.place-result-card:hover {
  background-color: #f8f9fa;
}

.place-result-name {
  font-weight: 600;
  font-size: 1rem;
  color: #212529;
  margin-bottom: 0.25rem;
}

.place-result-address {
  font-size: 0.875rem;
  color: #6c757d;
  margin-bottom: 0.25rem;
}

.place-result-rating {
  font-size: 0.875rem;
  color: #ff6b6b;
  font-weight: 500;
}

.place-selected {
  margin-top: 1rem;
  padding: 1rem;
  background: #d1f4dd;
  border-radius: 6px;
  border: 1px solid #51cf66;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.place-selected-title {
  color: #2b8a3e;
  font-weight: 600;
  font-size: 1rem;
  display: block;
  margin-bottom: 0.5rem;
}

.place-selected-details {
  font-size: 0.875rem;
  color: #495057;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

  