:root {
  --primary: #F9B000;
  --dark: #4d1818;
  --light: #fff;
  --gray: #f5f5f5;
  --text-color: #333;
  --secondary-text-color: #555;
  --border-color: #ddd;
  --shadow-light: rgba(0,0,0,0.08);
  --shadow-medium: rgba(0,0,0,0.15);
  --shadow-strong: rgba(0,0,0,0.25);
}

body {
  margin: 0;
  font-family: "Arial", sans-serif;
  background-color: var(--gray);
  color: var(--text-color);
  line-height: 1.6;
}

/* Global styles for a cleaner look */
*, *::before, *::after {
  box-sizing: border-box;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: "Arial", sans-serif;
}

/* HEADER */
.header {
  padding: 15px 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--light);
  box-shadow: 0 2px 10px var(--shadow-light);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.logo img {
  height: 100px; /* Slightly smaller logo for a modern feel */
  width: auto;
  transition: transform 0.3s ease;
}

.logo img:hover {
  transform: scale(1.02);
}

/* CONTAINER PERFIL */
.perfil-container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 30px;
  background: var(--light);
  border-radius: 12px; /* Slightly less rounded for professionalism */
  box-shadow: 0 10px 30px var(--shadow-medium); /* More pronounced but softer shadow */
  animation: fadeIn 0.5s ease-out;
}

.perfil-container h2 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 30px;
  font-size: 2.2rem;
  font-weight: 700;
}

/* TABS */
.tabs {
  display: flex;
  justify-content: center;
  gap: 15px; /* Reduced gap for a tighter look */
  margin-bottom: 30px;
  flex-wrap: wrap; /* Ensure tabs wrap on smaller screens */
}

.tab-btn {
  padding: 12px 28px;
  border: none;
  border-radius: 25px; /* Slightly less rounded */
  background: #e9e9e9; /* Lighter background for inactive tabs */
  color: var(--secondary-text-color);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  flex-grow: 1; /* Allow buttons to grow */
  max-width: 200px; /* Max width for individual buttons */
}

.tab-btn.active {
  background: var(--primary);
  color: var(--light);
  box-shadow: 0 4px 12px var(--shadow-light);
}

.tab-btn:hover:not(.active) {
  background: #e0e0e0; /* Subtle hover effect */
  transform: translateY(-2px);
}

/* CONTEÚDO */
.tab-content {
  display: none;
  padding-top: 10px; /* Space between tabs and content */
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

.tab-content h3 {
  color: var(--dark);
  margin-bottom: 25px;
  font-size: 1.8rem;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
  display: inline-block; /* Shrink border to content width */
}

/* FORMULÁRIO */
.dados-form {
  display: flex;
  flex-wrap: wrap;
  gap: 25px; /* Adjusted gap */
}

.dados-form .form-column {
  flex: 1;
  min-width: 280px; /* Adjusted min-width for better responsiveness */
}

.dados-form .form-group {
  margin-bottom: 18px;
}

.dados-form label {
  display: block;
  font-weight: 600; /* Slightly less bold */
  margin-bottom: 6px;
  color: var(--secondary-text-color);
  font-size: 0.95rem;
}

.dados-form input {
  width: 100%; /* Full width for inputs */
  padding: 12px 15px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 1rem;
  background: #fcfcfc; /* Lighter background */
  transition: all 0.3s ease;
}

.dados-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249, 176, 0, 0.2); /* Focus ring */
  outline: none;
}

.dados-form input:disabled {
  background-color: #f0f0f0;
  cursor: not-allowed;
}

.form-buttons {
  display: flex;
  gap: 15px; /* Espaçamento entre os botões */
  margin-top: 20px;
  flex-wrap: wrap; /* Permite que os botões quebrem a linha em telas menores */
}

.form-buttons {
    margin: auto;
}

.dados-form button {
  padding: 14px 25px;
  border: none;
  border-radius: 25px;
  background: var(--primary);
  color: var(--light);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-grow: 1; /* Permite que os botões cresçam para preencher o espaço */
  min-width: 160px; /* Largura mínima para os botões */
}

.dados-form button:hover {
  background: #e0a600;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px var(--shadow-light);
}

#btn-descartar {
  background-color: #6c757d; /* Uma cor mais neutra para descartar */
}

#btn-descartar:hover {
  background-color: #5a6268;
}

/* PEDIDOS */
#pedidos-container {
  display: grid;
  gap: 25px; /* Gap between order cards */
}

.pedido-card {
  background: var(--light);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 5px 15px var(--shadow-light);
  transition: all 0.3s ease;
  border: 1px solid #eee; /* Subtle border */
}

.pedido-card:hover {
  box-shadow: 0 8px 20px var(--shadow-medium);
  transform: translateY(-3px);
}

.pedido-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px dashed #eee; /* Dotted separator */
  padding-bottom: 15px;
}

.pedido-header p {
  margin: 5px 0;
  font-size: 0.95rem;
}

.pedido-header strong {
  color: var(--dark);
}

.status {
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 20px; /* Pill shape for status */
  color: var(--light);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status.pendente { background-color: #FF9800; }
.status.pago { background-color: #4CAF50; }
.status.cancelado { background-color: #f44336; }
.status.entregue { background-color: #2196F3; } /* New status color */
.status.em-transito { background-color: #F9B000; }

.nenhum-pedido {
  padding: 30px;
  text-align: center;
  font-size: 1.2rem;
  color: var(--secondary-text-color);
  background-color: #fefefe;
  border-radius: 10px;
  margin-top: 20px;
  border: 1px dashed #e0e0e0;
}

.pedido-itens {
  list-style: none;
  padding: 0;
  margin-top: 15px;
  border-top: 1px dashed #eee;
  padding-top: 15px;
}

.pedido-itens li {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px 0;
  font-size: 0.9rem;
  border-bottom: 1px dotted #f0f0f0;
}

.pedido-itens li:last-child {
  border-bottom: none;
}

.pedido-itens li img {
  width: 60px; /* Larger image for better visibility */
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  flex-shrink: 0; /* Prevent image from shrinking */
}

.pedido-itens li div {
  flex-grow: 1;
}

.pedido-itens li p {
  margin: 2px 0;
}

.pedido-detalhes {
  margin-top: 25px;
  background: linear-gradient(145deg, var(--light), #fdfdfd); /* Gradient background */
  padding: 25px;
  border-radius: 15px; /* Slightly more rounded */
  box-shadow: 0 8px 25px var(--shadow-light); /* Softer, more elegant shadow */
  animation: slideInUp 0.6s ease-out forwards; /* New animation */
  border: 1px solid #f0f0f0; /* Subtle border */
}

.pedido-detalhes h4 {
  color: var(--dark);
  margin-bottom: 15px;
  font-size: 1.2rem;
  font-weight: 700;
  border-bottom: 2px solid var(--primary); /* Mais proeminente */
  padding-bottom: 8px;
  display: inline-block;
  letter-spacing: 0.5px;
}

.pedido-detalhes p {
  margin: 6px 0;
  font-size: 0.95rem;
  color: var(--secondary-text-color);
}

.pedido-itens {
  list-style: none;
  padding: 0;
  margin-top: 20px;
  border-top: 1px solid #eee; /* Solid separator */
  padding-top: 20px;
}

.pedido-itens li {
  display: flex;
  align-items: center;
  gap: 18px; /* Increased gap */
  padding: 12px 0;
  font-size: 0.95rem;
  border-bottom: 1px solid #f5f5f5; /* Lighter separator */
  transition: background-color 0.3s ease;
}

.pedido-itens li:hover {
  background-color: #fcfcfc; /* Subtle hover effect */
}

.pedido-itens li:last-child {
  border-bottom: none;
}

.pedido-itens li img {
  width: 70px; /* Even larger image */
  height: 70px;
  object-fit: cover;
  border-radius: 10px; /* More rounded image corners */
  border: 1px solid #e5e5e5;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.pedido-itens li div {
  flex-grow: 1;
}

.pedido-itens li p {
  margin: 3px 0;
}

.toggle-detalhes-btn {
  margin-top: 20px;
  background: var(--primary);
  color: var(--light);
  border: none;
  padding: 12px 22px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  transition: all 0.3s ease;
  align-self: flex-end;
  box-shadow: 0 4px 10px var(--shadow-light);
}

.toggle-detalhes-btn:hover {
  background: #e6a000;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px var(--shadow-medium);
}

/* New animation for details */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Toast notifications */
#toast-container {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2000;
  max-width: 90%;
}

.toast {
  background: #333;
  color: #fff;
  padding: 14px 25px;
  border-radius: 10px;
  box-shadow: 0 6px 18px var(--shadow-medium);
  animation: fadeInOut 4s forwards;
  font-size: 0.95rem;
  text-align: center;
}

.toast.success { background: #4CAF50; }
.toast.error { background: #FF4C4C; }

/* Botão flutuante logout */
.logout-floating-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 15px 25px;
  background-color: #FF4C4C;
  color: var(--light);
  border: none;
  border-radius: 30px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--shadow-medium);
  transition: all 0.3s ease;
  z-index: 1000;
  font-size: 1rem;
}

.logout-floating-btn:hover {
  background-color: #e03b3b;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px var(--shadow-strong);
}

/* Keyframe Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(20px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(20px); }
}

/* Responsiveness */
@media (max-width: 768px) {
  .header {
    padding: 10px 15px;
  }

  .logo img {
    height: 80px;
  }

  .perfil-container {
    margin: 20px auto;
    padding: 20px;
    border-radius: 8px;
  }

  .perfil-container h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
  }

  .tabs {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
  }

  .tab-btn {
    max-width: 100%;
    padding: 10px 20px;
    font-size: 0.95rem;
  }

  .tab-content h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }

  .dados-form {
    flex-direction: column;
    gap: 15px;
  }

  .dados-form .form-column {
    min-width: 100%;
  }

  .dados-form button {
    width: 100%;
    margin-left: 0;
    margin-top: 15px;
  }

  #btn-descartar {
    margin-left: 0;
  }

  .pedido-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .pedido-header p {
    width: 100%;
  }

  .pedido-itens li {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .pedido-itens li img {
    width: 50px;
    height: 50px;
  }

  .logout-floating-btn {
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .perfil-container {
    padding: 15px;
  }

  .perfil-container h2 {
    font-size: 1.5rem;
  }

  .tab-content h3 {
    font-size: 1.3rem;
  }

  .dados-form input,
  .dados-form button {
    font-size: 0.9rem;
    padding: 10px 12px;
  }

  .toast {
    padding: 10px 15px;
    font-size: 0.85rem;
  }
}
