/* ========================================
   iFood Reviews - Estilos CSS
   ======================================== */

/* Reset e Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #ea1d2c;
  --primary-dark: #c4111e;
  --secondary-color: #3e3e3e;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --border-color: #dee2e6;
  --text-color: #333;
  --text-muted: #6c757d;
  --shadow: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
  --radius: 8px;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Navbar */
.navbar {
  background: white;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand a {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
}

.merchant-badge {
  background: var(--light-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-left: 15px;
  color: var(--text-muted);
}

.navbar-menu {
  display: flex;
  list-style: none;
  gap: 10px;
}

.navbar-menu a {
  padding: 8px 16px;
  text-decoration: none;
  color: var(--text-color);
  border-radius: var(--radius);
  transition: background 0.2s;
}

.navbar-menu a:hover,
.navbar-menu a.active {
  background: var(--light-color);
  color: var(--primary-color);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
  text-align: center;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.btn-outline:hover {
  background: var(--light-color);
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-ifood {
  background: var(--primary-color);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-block {
  display: block;
  width: 100%;
}

.inline {
  display: inline-block;
}

/* Forms */
.form-control {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-help {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* Alerts */
.alert {
  padding: 15px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* Cards */
.card,
.metric-card,
.review-card,
.rule-card,
.settings-card,
.form-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 15px;
}

.page-header h1 {
  font-size: 1.8rem;
  color: var(--secondary-color);
}

.header-actions {
  display: flex;
  gap: 10px;
}

/* Section */
.section {
  margin-top: 30px;
}

.section h2 {
  margin-bottom: 15px;
  color: var(--secondary-color);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

/* Login Page */
.login-container {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: white;
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.login-card h1 {
  color: var(--primary-color);
  margin-bottom: 5px;
}

.login-card .subtitle {
  color: var(--text-muted);
  margin-bottom: 30px;
}

.login-card .section {
  margin-top: 20px;
}

.login-card .section h2 {
  font-size: 1.1rem;
  margin-bottom: 15px;
}

.divider {
  display: flex;
  align-items: center;
  margin: 25px 0;
}

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

.divider span {
  padding: 0 15px;
  color: var(--text-muted);
}

/* Dashboard Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.metric-card {
  text-align: center;
  padding: 25px 20px;
}

.metric-value {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--secondary-color);
}

.metric-label {
  color: var(--text-muted);
  margin-top: 5px;
}

.metric-card.warning .metric-value {
  color: var(--warning-color);
}

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

.metric-value.negative {
  color: var(--danger-color);
}

/* Stars */
.star {
  color: #ddd;
  font-size: 1.2rem;
}

.star.filled {
  color: #ffc107;
}

.metric-stars {
  margin-top: 10px;
}

/* NPS */
.nps-detail {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 10px;
  font-size: 0.85rem;
}

.promoters { color: var(--success-color); }
.neutrals { color: var(--text-muted); }
.detractors { color: var(--danger-color); }

/* Rating Distribution */
.rating-distribution {
  max-width: 500px;
}

.rating-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.rating-label {
  width: 40px;
  text-align: right;
}

.bar-container {
  flex: 1;
  background: var(--light-color);
  border-radius: 4px;
  height: 20px;
}

.bar {
  height: 100%;
  background: var(--primary-color);
  border-radius: 4px;
  min-width: 2px;
}

.rating-count {
  width: 40px;
}

/* Comparative */
.comparative-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.comparative-item {
  text-align: center;
  padding: 15px;
  background: var(--light-color);
  border-radius: var(--radius);
}

.comparative-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.comparative-value {
  font-size: 1.5rem;
  font-weight: bold;
}

.comparative-rating {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Reviews List */
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.review-card {
  padding: 20px;
}

.review-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

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

.review-date {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.review-status,
.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-badge.answered,
.status-badge.active,
.review-status.answered {
  background: #d4edda;
  color: #155724;
}

.status-badge.pending,
.status-badge.inactive,
.review-status.pending {
  background: #fff3cd;
  color: #856404;
}

.review-customer {
  font-weight: 500;
  margin-bottom: 5px;
}

.review-comment {
  color: var(--text-muted);
  margin-bottom: 15px;
}

/* Reviews Table */
.reviews-table-container {
  overflow-x: auto;
}

.reviews-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.reviews-table th,
.reviews-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.reviews-table th {
  background: var(--light-color);
  font-weight: 600;
}

.reviews-table tr:hover {
  background: #fafafa;
}

.comment-cell {
  max-width: 300px;
}

.no-comment {
  color: var(--text-muted);
  font-style: italic;
}

/* Filters */
.filters {
  background: white;
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.filters-form {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.filter-group .form-control {
  width: auto;
  min-width: 150px;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.pagination-info {
  color: var(--text-muted);
}

/* Review Detail */
.review-detail-card {
  background: white;
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.review-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin: 20px 0;
  padding: 20px;
  background: var(--light-color);
  border-radius: var(--radius);
}

.info-row {
  display: flex;
  gap: 10px;
}

.info-label {
  color: var(--text-muted);
}

.info-value {
  font-weight: 500;
}

.review-comment-section,
.review-answer-section,
.reply-section {
  margin-top: 25px;
  padding-top: 25px;
  border-top: 1px solid var(--border-color);
}

.review-answer-section {
  background: #e8f5e9;
  padding: 20px;
  border-radius: var(--radius);
  border: none;
}

.answer-info {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.quick-replies {
  margin-top: 20px;
}

.quick-replies h4 {
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.quick-reply {
  margin-right: 10px;
  margin-bottom: 10px;
}

/* Auto Reply Rules */
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.rule-card {
  border-left: 4px solid var(--primary-color);
}

.rule-card.inactive {
  border-left-color: var(--text-muted);
  opacity: 0.7;
}

.rule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.rule-rating {
  font-weight: 600;
  color: var(--secondary-color);
}

.rule-template {
  color: var(--text-muted);
  margin-bottom: 15px;
  padding: 10px;
  background: var(--light-color);
  border-radius: var(--radius);
}

.rule-actions {
  display: flex;
  gap: 10px;
}

/* Templates Section */
.templates-section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
}

.template-suggestion {
  background: var(--light-color);
  padding: 15px;
  border-radius: var(--radius);
  margin-bottom: 15px;
}

.template-suggestion strong {
  display: block;
  margin-bottom: 8px;
}

.template-suggestion p {
  color: var(--text-muted);
  margin-bottom: 10px;
  font-size: 0.9rem;
}

/* Settings */
.settings-card {
  margin-bottom: 20px;
}

.settings-card h2 {
  margin-bottom: 10px;
}

.card-description {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.info-item {
  display: flex;
  gap: 10px;
}

.info-box {
  background: var(--light-color);
  padding: 20px;
  border-radius: var(--radius);
  margin-top: 20px;
}

.info-box h4 {
  margin-bottom: 10px;
}

.info-box ul {
  margin-left: 20px;
  color: var(--text-muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state p {
  margin-bottom: 10px;
}

.empty-state .btn {
  margin-top: 15px;
}

/* Error Page */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-card {
  text-align: center;
  padding: 60px;
}

.error-code {
  font-size: 6rem;
  font-weight: bold;
  color: var(--primary-color);
  line-height: 1;
}

.error-card h1 {
  margin: 20px 0 10px;
}

.error-card p {
  color: var(--text-muted);
  margin-bottom: 30px;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
    gap: 15px;
  }

  .navbar-menu {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .comparative-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .filters-form {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group .form-control {
    width: 100%;
  }

  .review-info {
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }
}
