/* 
 * Dunamis Growth - Owner Interface CSS
 * Production version - 2025-10-12
 */

/* Owner-specific variables */
:root {
  --owner-primary: #1976D2;
  --owner-primary-dark: #0D47A1;
  --owner-primary-light: #BBDEFB;
  --owner-accent: #2196F3;
  --owner-background: #F8F9FA;
  --owner-card-bg: #FFFFFF;
  --owner-text: #212121;
  --owner-text-secondary: #757575;
  --owner-divider: #E0E0E0;
  --owner-success: #4CAF50;
  --owner-warning: #FF9800;
  --owner-error: #F44336;
  --owner-revenue: #4CAF50;
  --owner-customers: #2196F3;
  --owner-rating: #FF9800;
  --owner-growth: #9C27B0;
}

/* Modal Base Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.3s;
}

.modal.active,
.modal:target {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 0;
  border: 1px solid #888;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s;
}

@keyframes slideIn {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--owner-primary) 0%, var(--owner-primary-dark) 100%);
  color: white;
  border-radius: 8px 8px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-header .close,
.modal-header .close-btn {
  color: white;
  font-size: 28px;
  font-weight: bold;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
  padding: 0;
  margin: 0;
  line-height: 1;
}

.modal-header .close:hover,
.modal-header .close-btn:hover {
  opacity: 1;
}

.modal-body {
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: #f5f5f5;
  border-radius: 0 0 8px 8px;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  border-top: 1px solid #e0e0e0;
}

.modal-footer button,
.modal-actions button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.modal-footer .primary-button,
.modal-actions .btn-primary {
  background: var(--owner-primary);
  color: white;
}

.modal-footer .primary-button:hover,
.modal-actions .btn-primary:hover {
  background: var(--owner-primary-dark);
}

.modal-footer .secondary-button,
.modal-actions .btn-secondary {
  background: #f0f0f0;
  color: #333;
}

.modal-footer .secondary-button:hover,
.modal-actions .btn-secondary:hover {
  background: #e0e0e0;
}

/* Form styles in modals */
.modal .form-group {
  margin-bottom: 1.25rem;
}

.modal .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #333;
  font-weight: 500;
}

.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus {
  outline: none;
  border-color: var(--owner-primary);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

/* Menu Management Modal - Responsive */
#add-menu-item-modal .modal-content {
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 5% auto;
}

#add-menu-item-form {
  padding: 1rem;
}

#add-menu-item-form .form-group {
  margin-bottom: 1rem;
}

#add-menu-item-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: #333;
  font-weight: 500;
}

#add-menu-item-form input,
#add-menu-item-form select,
#add-menu-item-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
}

#add-menu-item-form input:focus,
#add-menu-item-form select:focus,
#add-menu-item-form textarea:focus {
  outline: none;
  border-color: var(--owner-primary);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

#add-menu-item-form .modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

#add-menu-item-form .modal-actions button {
  padding: 0.75rem 1.5rem;
  min-width: 100px;
}

/* Image URL field helper text */
#add-menu-item-form input[name="photoUrl"] {
  font-size: 0.95rem;
}

#add-menu-item-form input[name="photoUrl"]::placeholder {
  color: #999;
  font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #add-menu-item-modal .modal-content {
    width: 95%;
    margin: 2% auto;
    max-height: 95vh;
  }
  
  #add-menu-item-form {
    padding: 0.75rem;
  }
  
  #add-menu-item-form .modal-actions {
    flex-direction: column-reverse;
  }
  
  #add-menu-item-form .modal-actions button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  #add-menu-item-modal .modal-content {
    width: 100%;
    margin: 0;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* Owner interface specific styles */
.owner-interface {
  background-color: var(--owner-background);
}

.owner-interface .sidebar-header h1 {
  color: var(--owner-primary);
  font-weight: 700;
}

.owner-interface .nav-link.active {
  background-color: var(--owner-primary-light);
  color: var(--owner-primary-dark);
}

.owner-interface .nav-link:hover {
  background-color: var(--owner-primary-light);
}

/* Owner Welcome Section */
.owner-welcome {
  margin-bottom: 2rem;
}

.owner-welcome .card {
  background: linear-gradient(135deg, var(--owner-primary), var(--owner-accent));
  color: white;
  border: none;
  box-shadow: 0 4px 20px rgba(25, 118, 210, 0.3);
}

.owner-welcome .card-title h3 {
  color: white;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.owner-welcome .card-content p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

/* Business Overview Stats */
.business-overview {
  margin-bottom: 2rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--owner-card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card.revenue .stat-icon {
  background: linear-gradient(135deg, var(--owner-revenue), #66BB6A);
  color: white;
}

.stat-card.customers .stat-icon {
  background: linear-gradient(135deg, var(--owner-customers), #42A5F5);
  color: white;
}

.stat-card.rating .stat-icon {
  background: linear-gradient(135deg, var(--owner-rating), #FFB74D);
  color: white;
}

.stat-card.growth .stat-icon {
  background: linear-gradient(135deg, var(--owner-growth), #BA68C8);
  color: white;
}

.stat-icon i {
  font-size: 28px;
}

.stat-content h4 {
  color: var(--owner-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  color: var(--owner-text);
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  line-height: 1;
}

.stat-change {
  color: var(--owner-success);
  font-size: 0.875rem;
  margin: 0;
  font-weight: 500;
}

.stat-change.negative {
  color: var(--owner-error);
}

/* Dashboard Sections */
.dashboard-sections {
  margin-bottom: 2rem;
}

.section-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}

/* Performance Chart */
#recent-performance-chart {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#performanceCanvas {
  max-width: 100%;
  height: auto;
}

/* Reviews List */
#top-reviews-list {
  max-height: 200px;
  overflow-y: auto;
}

.review-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--owner-divider);
}

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

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.review-rating {
  display: flex;
  gap: 2px;
}

.review-rating .star {
  color: #FFD700;
  font-size: 16px;
}

.review-rating .star.empty {
  color: var(--owner-divider);
}

.review-text {
  color: var(--owner-text-secondary);
  font-size: 0.875rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.review-author {
  color: var(--owner-text);
  font-weight: 500;
  font-size: 0.875rem;
}

.review-date {
  color: var(--owner-text-secondary);
  font-size: 0.75rem;
}

/* Scripture Container */
.scripture-container {
  text-align: center;
  padding: 1rem;
}

.scripture-container blockquote {
  font-size: 1.125rem;
  font-style: italic;
  color: var(--owner-text);
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

.scripture-container cite {
  color: var(--owner-primary);
  font-weight: 500;
  font-size: 0.875rem;
}

/* Quick Actions Grid */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.quick-action-btn {
  background: var(--owner-card-bg);
  border: 2px solid var(--owner-divider);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--owner-text);
}

.quick-action-btn:hover {
  border-color: var(--owner-primary);
  background: var(--owner-primary-light);
  transform: translateY(-2px);
}

.quick-action-btn i {
  font-size: 32px;
  color: var(--owner-primary);
}

.quick-action-btn span {
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
}

/* Business Insights */
.insights-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.insight-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--owner-background);
  border-radius: 8px;
}

.insight-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--owner-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.insight-icon i {
  color: var(--owner-primary);
  font-size: 20px;
}

.insight-content h5 {
  color: var(--owner-text);
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
}

.insight-content p {
  color: var(--owner-text-secondary);
  font-size: 0.75rem;
  margin: 0;
  line-height: 1.4;
}

/* Performance Tab Styles */
.performance-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--owner-card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.metric-title {
  color: var(--owner-text);
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.metric-period {
  color: var(--owner-text-secondary);
  font-size: 0.75rem;
  background: var(--owner-background);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.metric-value {
  color: var(--owner-text);
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  line-height: 1;
}

.metric-change {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.metric-change.positive {
  color: var(--owner-success);
}

.metric-change.negative {
  color: var(--owner-error);
}

.metric-change i {
  font-size: 16px;
}

/* Charts Container */
.charts-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: var(--owner-card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.chart-title {
  color: var(--owner-text);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.chart-controls {
  display: flex;
  gap: 0.5rem;
}

.chart-control-btn {
  background: var(--owner-background);
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--owner-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-control-btn.active,
.chart-control-btn:hover {
  background: var(--owner-primary);
  color: white;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .stats-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .section-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .charts-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .quick-action-btn {
    padding: 1rem 0.5rem;
  }
  
  .quick-action-btn i {
    font-size: 24px;
  }
  
  .quick-action-btn span {
    font-size: 0.75rem;
  }
  
  .performance-metrics {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .stat-card {
    padding: 1rem;
  }
  
  .stat-icon {
    width: 50px;
    height: 50px;
  }
  
  .stat-icon i {
    font-size: 24px;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  .quick-actions-grid {
    grid-template-columns: 1fr;
  }
  
  .insight-item {
    padding: 0.75rem;
  }
  
  .insight-icon {
    width: 35px;
    height: 35px;
  }
  
  .insight-icon i {
    font-size: 18px;
  }
}
