/* ========================================
   DASHBOARD STYLES - Second Street Music
   Extracted from inline styles in dashboard.html
   ======================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--theme-surface, #f5f5f5);
  color: var(--theme-text, #1a1a1a);
  line-height: 1.6;
}

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--theme-primary, #667eea) 0%, var(--theme-primary-alt, #764ba2) 100%);
}

.login-box {
  background: var(--theme-background, white);
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 400px;
}

.login-box h1 {
  font-size: 28px;
  margin-bottom: 10px;
  color: var(--theme-primary, #667eea);
}

.login-box p {
  color: var(--theme-text-secondary, #666);
  margin-bottom: 30px;
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 14px;
  color: var(--theme-text, #555);
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--theme-border, #ddd);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background: var(--theme-background, white);
  color: var(--theme-text, #1a1a1a);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--theme-primary, #667eea);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  font-family: 'Courier New', monospace;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--theme-primary, #667eea);
  color: var(--theme-text-on-primary, white);
}

.btn-primary:hover {
  background: var(--theme-primary-alt, #5568d3);
}

.btn-secondary {
  background: var(--theme-surface, #f5f5f5);
  color: var(--theme-text, #555);
  border: 1px solid var(--theme-border, #ddd);
}

.btn-secondary:hover {
  background: var(--theme-neutral-alt, #eee);
}

.btn-danger {
  background: var(--theme-error, #e74c3c);
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

.btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.error-message {
  background: #ffebee;
  color: #c62828;
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 14px;
  border-left: 4px solid #c62828;
}

/* Admin Panel */
.admin-container {
  display: none;
  min-height: 100vh;
  flex-direction: column;
}

.admin-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--theme-background, white);
  border-bottom: 1px solid var(--theme-border, #e0e0e0);
  padding: 15px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  z-index: 1000;
}

.admin-header .header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.admin-header .header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.admin-header h1 {
  font-size: 20px;
  color: var(--theme-primary, #667eea);
  margin: 0;
  flex: 1;
  text-align: center;
}

.admin-header .user-info {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 14px;
}

/* Account dropdown styles (copied from ssos-checkout.js pattern) */
#account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--theme-background, white);
  border: 1px solid var(--theme-border, #e0e0e0);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 200px;
  z-index: 10000;
  overflow: hidden;
  text-align: left;
}

#account-dropdown > div {
  padding: 12px 16px;
  cursor: default;
  transition: background 0.2s;
  color: var(--theme-text, #1a1a1a);
  display: flex;
  align-items: center;
  gap: 8px;
}

#account-dropdown > div:hover {
  background: var(--theme-primary-light, rgba(102, 126, 234, 0.1));
}

.user-name {
  font-weight: 500;
  color: var(--theme-text, #1a1a1a);
}

.user-role {
  color: var(--theme-text-secondary, #666);
  font-size: 12px;
}

.admin-content {
  display: flex;
  flex: 1;
}

/* ========================================
   SIDEBAR & NAVIGATION
   ======================================== */

.sidebar {
  position: fixed;
  left: 0;
  top: 60px;
  width: 280px;
  height: calc(100vh - 60px);
  background: var(--theme-background, white);
  border-right: 1px solid var(--theme-border, #e5e5e5);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 999;
  transition: left 0.3s ease;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1001;
  background: var(--theme-background, white);
  border: 1px solid var(--theme-border, #e5e5e5);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
}

.sidebar-overlay.visible {
  display: block;
}

/* Navigation Sections */
.nav-section {
  margin: 4px 0;
}

.nav-section-header {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--theme-text-secondary, #999);
  text-transform: uppercase;
}

.nav-section-header.collapsible {
  cursor: pointer;
  transition: background 0.2s;
}

.nav-section-header.collapsible:hover {
  background: var(--theme-surface, #f8f9fa);
}

.nav-section-icon {
  margin-right: 8px;
  font-size: 16px;
}

.nav-section-label {
  flex: 1;
}

.nav-section-collapse-icon {
  margin-left: auto;
  transition: transform 0.2s;
  font-size: 12px;
}

.nav-section.collapsed .nav-section-collapse-icon {
  transform: rotate(-90deg);
}

.nav-section-items {
  display: block;
}

.nav-section.collapsed .nav-section-items {
  display: none;
}

/* Navigation Items */
.nav-item {
  padding: 6px 16px 6px 40px;
  cursor: pointer;
  font-size: 14px;
  color: var(--theme-text, #555);
  border-left: 3px solid transparent;
  transition: all 0.2s;
  position: relative;
}

.nav-item:hover {
  background: var(--theme-surface, #f5f7fa);
  color: var(--theme-primary, #667eea);
}

.nav-item.active {
  background: var(--theme-neutral-alt, #f0f4ff);
  color: var(--theme-primary, #667eea);
  border-left-color: var(--theme-primary, #667eea);
  font-weight: 500;
}

.nav-item.disabled {
  color: var(--theme-text-secondary, #999);
  cursor: default;
  opacity: 0.5;
}

/* Growth Path Sections */
.nav-section.growth-path {
  position: relative;
  border: 1px dashed #d0d0d0;
  border-radius: 6px;
  padding: 12px;
  margin: 12px 8px;
  background: var(--theme-surface, linear-gradient(135deg, #f8f9ff 0%, #fff 100%));
  opacity: 0.7;
  transition: all 0.2s;
}

.nav-section.growth-path::before {
  content: '✨ UPGRADE TO UNLOCK';
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--theme-primary, #667eea);
  margin-bottom: 8px;
  text-align: center;
}

.nav-section.growth-path:hover {
  opacity: 1;
  border-color: var(--theme-primary, #667eea);
  cursor: pointer;
}

.nav-section.growth-path .nav-section-header {
  opacity: 0.8;
  padding: 8px 12px;
}

.nav-section.growth-path .nav-item {
  color: var(--theme-text-secondary, #999);
  cursor: default;
  pointer-events: none;
  padding-left: 36px;
}

.nav-section.growth-path .nav-item::after {
  content: '🔒';
  position: absolute;
  right: 12px;
  opacity: 0.6;
  font-size: 12px;
}

/* Placeholder Items */
.nav-item.placeholder {
  position: relative;
  opacity: 0.6;
}

.nav-item.placeholder::before {
  content: '🚧';
  margin-right: 6px;
  font-size: 12px;
}

.nav-item.placeholder:hover {
  opacity: 1;
  background: var(--theme-warning-light, #fff9e6);
}

.nav-item.placeholder:hover::after {
  content: 'Coming Soon';
  position: absolute;
  right: 12px;
  font-size: 10px;
  color: var(--theme-warning, #f59e0b);
  background: var(--theme-warning-lighter, #fffbeb);
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
}

/* Section Divider */
.nav-divider {
  display: none;
}

/* Section Header */
.nav-header {
  padding: 8px 16px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--theme-text-secondary, #999);
  text-transform: uppercase;
}

.main-content {
  margin-left: 280px;
  padding: 30px;
  padding-top: 90px; /* 60px header + 30px spacing */
  overflow-y: auto;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  .sidebar {
    left: -280px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-toggle {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  /* All collapsible sections start collapsed on tablet */
  .nav-section.collapsible {
    /* Will be set via JavaScript */
  }
}

/* Mobile (<768px) */
@media (max-width: 768px) {
  .sidebar {
    left: -100%;
    width: 85%;
    max-width: 320px;
    top: 0;
    height: 100vh;
  }

  .sidebar.open {
    left: 0;
  }

  .admin-header h1 {
    font-size: 18px;
  }

  .main-content {
    padding: 16px;
    padding-top: 76px; /* 60px header + 16px spacing */
    padding-bottom: 72px; /* Space for context bar */
  }

  .user-info {
    font-size: 12px;
  }

  .user-info .btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* Mobile Context Bar */
.mobile-context-bar {
  display: none;
}

@media (max-width: 768px) {
  .mobile-context-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--theme-background, #fff);
    border-top: 1px solid var(--theme-border, #e5e5e5);
    z-index: 999;
    padding: 0 8px;
    gap: 8px;
    align-items: center;
    justify-content: space-around;
  }

  .context-action {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
  }

  .context-action:active {
    background: var(--theme-surface, #f5f5f5);
  }

  .context-action-icon {
    font-size: 20px;
    margin-bottom: 4px;
  }

  .context-action-label {
    font-size: 10px;
    color: var(--theme-text-secondary, #666);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
  }
}

.module-content {
  display: none;
}

.module-content.active {
  display: block;
}

.module-header {
  margin-bottom: 30px;
}

.module-header h2 {
  font-size: 28px;
  color: var(--theme-text, #333);
  margin-bottom: 8px;
}

.module-header p {
  color: var(--theme-text-secondary, #666);
  font-size: 14px;
}

.sub-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--theme-border, #e0e0e0);
  padding-bottom: 0;
}

.sub-tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--theme-text-secondary, #666);
  transition: all 0.2s;
}

.sub-tab:hover {
  color: var(--theme-primary, #667eea);
}

.sub-tab.active {
  color: var(--theme-primary, #667eea);
  border-bottom-color: var(--theme-primary, #667eea);
}

.sub-tab-content {
  display: none;
}

.sub-tab-content.active {
  display: block;
}

.card {
  background: var(--theme-background, white);
  padding: 25px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.card h3 {
  font-size: 18px;
  margin-bottom: 15px;
  color: var(--theme-text, #333);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-box, .success-box, .warning-box, .error-box {
  padding: 15px;
  border-radius: 4px;
  border-left: 4px solid;
  margin: 15px 0;
  font-size: 14px;
}

.info-box {
  background: var(--theme-surface, #e3f2fd);
  border-left-color: #2196F3;
  color: var(--theme-text, #1565c0) !important;
}

.info-box p, .info-box span, .info-box strong {
  color: inherit;
}

.success-box {
  background: var(--theme-surface, #e8f5e9);
  border-left-color: #4CAF50;
  color: var(--theme-text, #2e7d32) !important;
}

.success-box p, .success-box span, .success-box strong {
  color: inherit;
}

.warning-box {
  background: var(--theme-surface, #fff3e0);
  border-left-color: #ff9800;
  color: var(--theme-text, #e65100) !important;
}

.warning-box p, .warning-box span, .warning-box strong {
  color: inherit;
}

.error-box {
  background: var(--theme-surface, #ffebee);
  border-left-color: #f44336;
  color: var(--theme-text, #c62828) !important;
}

.error-box p, .error-box span, .error-box strong {
  color: inherit;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  font-size: 13px;
}

.data-table th, .data-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--theme-border, #e0e0e0);
}

.data-table th {
  background: var(--theme-surface, #f9f9f9);
  font-weight: 600;
  color: var(--theme-text, #555);
}

.data-table tr:hover {
  background: var(--theme-surface, #f5f5f5);
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-warning {
  background: var(--theme-warning-light, #fff3e0);
  color: var(--theme-warning-dark, #e65100);
}

.badge-error {
  background: #ffebee;
  color: #c62828;
}

.badge-info {
  background: #e3f2fd;
  color: #1565c0;
}

.badge-global {
  background: var(--theme-surface, #f5f5f5);
  color: var(--theme-text-secondary, #666);
  border: 1px solid var(--theme-border, #ddd);
}

.badge-combo {
  background: #e8f5e9;
  color: #2e7d32;
}

.hidden {
  display: none !important;
}

.loader {
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--theme-primary, #667eea);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--theme-background, white);
  padding: 20px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-value {
  font-size: 32px;
  font-weight: 600;
  color: var(--theme-primary, #667eea);
  margin-bottom: 5px;
}

.stat-label {
  font-size: 14px;
  color: var(--theme-text-secondary, #666);
}

/* Standalone modal (not inside modal-overlay) */
.modal:not(.modal-overlay .modal) {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active:not(.modal-overlay .modal) {
  display: flex;
}

.modal-content {
  background: var(--theme-background, white);
  border-radius: 8px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--theme-text, #1a1a1a);
}

.modal-footer {
  margin-top: 25px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.modal-overlay .modal {
  background: var(--theme-background, white);
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.code-block {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 15px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  margin: 15px 0;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--theme-text-secondary, #999);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.help-text {
  color: var(--theme-text-secondary, #666);
  font-size: 14px;
  margin-bottom: 15px;
  line-height: 1.5;
}

select[multiple] {
  min-height: 120px;
}

/* Media Module Tabs */
.sub-nav-btn {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--theme-text-secondary, #666);
  transition: all 0.2s ease;
}

.sub-nav-btn:hover {
  color: var(--theme-text, #333);
  background: var(--theme-surface, #f5f5f5);
}

.sub-nav-btn.active {
  color: var(--theme-primary, #4a90e2);
  border-bottom-color: var(--theme-primary, #4a90e2);
}

.media-tab {
  display: none;
}

.media-tab.active {
  display: block;
}

/* Prompt Template Table */
.template-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.template-badge.default {
  background: #e3f2fd;
  color: #1976d2;
}

.template-badge.service {
  background: #f3e5f5;
  color: #7b1fa2;
}

.template-badge.room {
  background: #e8f5e9;
  color: #388e3c;
}

.template-badge.specific {
  background: var(--theme-warning-light, #fff3e0);
  color: var(--theme-warning-dark, #f57c00);
}

.priority-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--theme-text-secondary, #666);
}
