/* Modernized styles.css - substitua o arquivo atual por este */

/* Fonte (import no CSS para conveniência) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&display=swap');

:root{
  --bg-1: #0f172a;    /* página */
  --accent-1: #5eead4;    /* verde água */
  --accent-2: #7c3aed;    /* roxo */
  --card-bg: rgba(255,255,255,0.04);
  --glass: rgba(255,255,255,0.06);
  --muted: #9aa4b2;
  --white: #ffff;
  --success: #10b981;
  --danger: #ef4444;
  --shadow: 0 10px 30px rgba(2,6,23,0.6);
  --radius-lg: 14px;
  --radius-md: 10px;
}

[data-theme="light"] {
  --bg-1: #f1f5f9;    /* página */
  --accent-1: #0d9488;    /* verde água */
  --accent-2: #7c3aed;    /* roxo */
  --card-bg: rgba(255,255,255,0.8);
  --glass: rgba(255,255,255,0.9);
  --muted: #64748b;
  --white: #0f172a;
  --success: #10b981;
  --danger: #ef4444;
  --shadow: 0 10px 30px rgba(2,6,23,0.1);
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: radial-gradient(1200px 600px at 10% 10%, rgba(124,58,237,0.12), transparent 8%),
    linear-gradient(180deg, #071029 0%, #071428 60%);
  color: var(--white);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  padding:28px;
}

[data-theme="light"] body {
  background: radial-gradient(1200px 600px at 10% 10%, rgba(124,58,237,0.08), transparent 8%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 60%);
  color: var(--white);
}

/* Container central */
.container{
  max-width:990px;
  margin:0 auto;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius: var(--radius-lg);
  overflow:hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.03);
}

[data-theme="light"] .container {
  background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.7));
  border: 1px solid rgba(0,0,0,0.05);
}

/* Header com logo e subtítulo */
.header{
  padding:32px;
  background: linear-gradient(90deg, rgba(124,58,237,0.12), rgba(94,234,212,0.06));
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  text-align:center;
  position:relative;
}

[data-theme="light"] .header {
  background: linear-gradient(90deg, rgba(124,58,237,0.08), rgba(94,234,212,0.04));
}

.header h1{
  font-size:22px;
  font-weight:800;
  letter-spacing: -0.4px;
  color: var(--white);
  display:flex;
  gap:8px;
  align-items:center;
}

[data-theme="light"] .header h1 {
  color: var(--white);
}

.header p{
  color: var(--muted);
  font-size:14px;
  max-width:720px;
}

/* Conteúdo interno */
.content{
  padding:28px 36px 44px;
  display:flex;
  flex-direction:column;
  gap:20px;
}

/* Botões de modo */
.mode-buttons{
  display:flex;
  gap:12px;
  justify-content:center;
  flex-wrap:wrap;
}

.mode-btn{
  background:transparent;
  color:var(--white);
  border:1px solid rgba(255,255,255,0.06);
  padding:10px 18px;
  border-radius:999px;
  cursor:pointer;
  font-weight:600;
  letter-spacing:0.2px;
  transition:all 180ms ease;
  box-shadow: 0 4px 14px rgba(3,7,18,0.45);
  display:inline-flex;
  gap:8px;
  align-items:center;
}

[data-theme="light"] .mode-btn {
  color: var(--white);
  border:1px solid rgba(0,0,0,0.1);
  box-shadow: 0 4px 14px rgba(3,7,18,0.1);
}

.mode-btn:hover{ transform: translateY(-3px); box-shadow:0 12px 30px rgba(3,7,18,0.6) }

[data-theme="light"] .mode-btn:hover {
  box-shadow:0 12px 30px rgba(3,7,18,0.2);
}

.mode-btn.active{
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  border: none;
  color:#021023;
  box-shadow: 0 8px 30px rgba(124,58,237,0.18), 0 2px 6px rgba(0,0,0,0.25);
}

/* SEC: grupos (cards) */
#file-sections{
  display:flex;
  gap:16px;
  align-items:flex-start;
}
.group-section{
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius: var(--radius-md);
  overflow:hidden;
  border:1px solid rgba(255,255,255,0.03);
  display:flex;
  flex-direction:column;
  flex:1 1 320px;
  min-width:280px;
}

[data-theme="light"] .group-section {
  background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.7));
  border:1px solid rgba(0,0,0,0.05);
}

/* título do grupo */
.group-title{
  background: linear-gradient(90deg, rgba(7,10,24,0.6), rgba(7,10,24,0.4));
  padding:14px 18px;
  font-weight:700;
  color:var(--white);
  border-bottom:1px solid rgba(255,255,255,0.02);
}

[data-theme="light"] .group-title {
  background: linear-gradient(90deg, rgba(255,255,255,0.8), rgba(255,255,255,0.7));
  color: var(--white);
  border-bottom:1px solid rgba(0,0,0,0.05);
}

/* linhas de arquivos */
.file-row{
  display:flex;
  align-items:center;
  gap:16px;
  padding:14px 18px;
  border-bottom: 1px dashed rgba(255,255,255,0.02);
}

[data-theme="light"] .file-row {
  border-bottom: 1px dashed rgba(0,0,0,0.05);
}

.file-row:last-child{ border-bottom: none }

.file-btn{
  background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  color:var(--white);
  border: none;
  padding:10px 18px;
  border-radius:10px;
  cursor:pointer;
  font-weight:700;
  display:inline-flex;
  align-items:center;
  gap:10px;
  transition: transform 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 6px 18px rgba(2,6,23,0.45);
}

[data-theme="light"] .file-btn {
  background: linear-gradient(90deg, rgba(0,0,0,0.05), rgba(0,0,0,0.02));
  color: var(--white);
  box-shadow: 0 6px 18px rgba(2,6,23,0.1);
}

.file-btn:hover{ transform: translateY(-4px); box-shadow: 0 18px 40px rgba(2,6,23,0.55) }

[data-theme="light"] .file-btn:hover {
  box-shadow: 0 18px 40px rgba(2,6,23,0.2);
}

.file-status{
  color: var(--muted);
  font-size:13px;
  margin-left:auto;
  font-style:italic;
  max-width:48%;
  text-overflow:ellipsis;
  white-space:nowrap;
  overflow:hidden;
}

/* Campo nome do arquivo (oculto no modo cadastroProdutos) */
.filename-section{
  display:flex;
  gap:12px;
  justify-content:center;
  align-items:center;
  flex-wrap:wrap;
}

.filename-label{ color:var(--muted); font-size:14px; font-weight:600 }

.filename-input{
  padding:12px 18px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  color:var(--white);
  min-width:260px;
  text-align:center;
  transition: box-shadow 150ms ease, transform 120ms ease;
}

[data-theme="light"] .filename-input {
  border:1px solid rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.8);
  color: var(--white);
}

.filename-input:focus{ outline:none; box-shadow:0 10px 30px rgba(124,58,237,0.12); transform: translateY(-2px) }

[data-theme="light"] .filename-input:focus {
  box-shadow:0 10px 30px rgba(124,58,237,0.1);
}

/* Barra de progresso estilizada e animada */
.progress-bar{
  width:100%;
  height:10px;
  background: linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius:999px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,0.02);
}

[data-theme="light"] .progress-bar {
  background: linear-gradient(90deg, rgba(0,0,0,0.05), rgba(0,0,0,0.02));
  border:1px solid rgba(0,0,0,0.05);
}

.progress-fill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  transition: width 450ms cubic-bezier(.2,.9,.2,1);
  box-shadow: 0 6px 18px rgba(124,58,237,0.12) inset;
}

/* efeito indeterminado */
.progress-fill.active{
  width:100%;
  background-size: 200% 100%;
  animation: progress-sweep 1.6s linear infinite;
}
@keyframes progress-sweep{
  from{ background-position: 100% 0 }
  to{ background-position: 0 0 }
}

/* status label */
.status-label{
  text-align:center;
  color:var(--muted);
  font-size:14px;
  min-height:22px;
}

/* Botão confirmar principal */
.confirm-btn{
  display:block;
  margin:6px auto 0;
  padding:14px 22px;
  border-radius:12px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-1));
  color:#021023;
  font-weight:800;
  border:none;
  cursor:pointer;
  font-size:16px;
  box-shadow: 0 14px 40px rgba(7,10,24,0.6);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

[data-theme="light"] .confirm-btn {
  box-shadow: 0 14px 40px rgba(7,10,24,0.2);
}

.confirm-btn:hover:not(:disabled){ transform: translateY(-4px); box-shadow: 0 22px 60px rgba(7,10,24,0.7) }

[data-theme="light"] .confirm-btn:hover:not(:disabled) {
  box-shadow: 0 22px 60px rgba(7,10,24,0.3);
}

.confirm-btn:disabled{
  opacity:0.4;
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}

/* Produtos - tabela refinada */
.tabela-title{
  text-align:center;
  font-weight:700;
  padding:16px 8px;
  color:var(--white);
  letter-spacing:0.3px;
}

[data-theme="light"] .tabela-title {
  color: var(--white);
}

#products-list{
  max-height:420px;
  overflow:auto;
  padding:12px;
}

/* tabela com cabeçalho fixo */
.products-table{
  width:100%;
  border-collapse:collapse;
  background:transparent;
  color:var(--white);
}
.products-table thead th{
  position:sticky;
  top:0;
  background: linear-gradient(180deg, rgb(2,6,23), rgb(2,6,23));
  padding:10px;
  text-align:left;
  font-size:13px;
  color:var(--muted);
  border-bottom:1px solid rgba(255,255,255,0.03);
}

[data-theme="light"] .products-table thead th {
  background: linear-gradient(180deg, rgb(224, 224, 224), rgb(224, 224, 224));
  color: var(--muted);
  border-bottom:1px solid rgba(0,0,0,0.05);
}

.products-table tbody td{
  padding:10px;
  font-size:14px;
  color:var(--white);
  border-bottom:1px solid rgba(255,255,255,0.02);
}

[data-theme="light"] .products-table tbody td {
  color: var(--white);
  border-bottom:1px solid rgba(0,0,0,0.05);
}

/* linhas zebra sutil */
.products-table tbody tr:nth-child(even){
  background: linear-gradient(180deg, rgba(255,255,255,0.01), transparent);
}

[data-theme="light"] .products-table tbody tr:nth-child(even) {
  background: linear-gradient(180deg, rgba(0,0,0,0.02), transparent);
}

/* botões da tabela */
.btn{
  padding:8px 12px;
  border-radius:8px;
  font-weight:700;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:none;
  transition:transform 120ms ease, opacity 120ms ease;
}

.btn-add{ background: linear-gradient(90deg, var(--accent-1), var(--accent-2)); color:#021023 }
.btn-refresh{ background: rgba(255,255,255,0.04); color:var(--white) }
.btn-edit{ background: #3b82f6; color:#fff }
.btn-delete{ background: var(--danger); color:#fff; padding:6px 10px; border-radius:6px }

[data-theme="light"] .btn-refresh {
  background: rgba(0,0,0,0.05);
  color: var(--white);
}

.btn:hover{ transform: translateY(-3px) }

/* modal */
.modal-overlay{
  position:fixed;
  inset:0;
  background: rgba(2,6,23,0.62);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:1100;
  padding:20px;
}

[data-theme="light"] .modal-overlay {
  background: rgba(2,6,23,0.4);
}

.modal-container{
  width:100%;
  max-width:520px;
  background: linear-gradient(180deg, rgb(2,6,23), rgb(2,6,23));
  border-radius:12px;
  padding:20px;
  border:1px solid rgba(255,255,255,0.04);
  box-shadow: 0 20px 60px rgb(2,6,23);
}

[data-theme="light"] .modal-container {
  background: linear-gradient(180deg, rgb(255,255,255), rgb(255,255,255));
  border:1px solid rgba(0,0,0,0.1);
  box-shadow: 0 20px 60px rgba(2,6,23);
}

.modal-title{ font-size:18px; font-weight:800; color:var(--white); text-align:center; margin-bottom:12px }

[data-theme="light"] .modal-title {
  color: var(--white);
}

.modal-form{ display:flex; flex-direction:column; gap:12px }
.modal-form input{
  padding:12px 14px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.02);
  color:var(--white);
}

[data-theme="light"] .modal-form input {
  border:1px solid rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.8);
  color: var(--white);
}

.modal-buttons{ display:flex; gap:10px; margin-top:6px }
.btn-modal{ flex:1; padding:10px 12px; border-radius:8px; font-weight:700 }
.btn-save{ background: linear-gradient(90deg,var(--accent-1),var(--accent-2)); color:#021023 }
.btn-cancel{ background: rgba(255,255,255,0.04); color:var(--white) }

[data-theme="light"] .btn-cancel {
  background: rgba(0,0,0,0.05);
  color: var(--white);
}

.modal-close{
  position:absolute;
  right:14px;
  top:10px;
  border:none;
  background:transparent;
  color:var(--muted);
  font-size:20px;
  cursor:pointer;
}

/* ações */
.action-buttons{ display:flex; gap:8px; align-items:center; }

/* rolagem custom */
#products-list::-webkit-scrollbar{ width:10px }
#products-list::-webkit-scrollbar-thumb{ background: linear-gradient(180deg, rgba(124,58,237,0.3), rgba(94,234,212,0.3)); border-radius:8px }

/* hidden helper */
.hidden{ display:none !important }

/* Theme toggle button */
.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 18px;
  transition: all 0.3s ease;
}

[data-theme="light"] .theme-toggle {
  background: rgba(0,0,0,0.1);
  color: var(--white);
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.2);
  transform: rotate(15deg);
}

[data-theme="light"] .theme-toggle:hover {
  background: rgba(0,0,0,0.2);
}

/* Responsividade */
@media (max-width:820px){
  .content{ padding:20px }
  .header{ padding:22px }
  .file-status{ max-width:36% }
}

@media (max-width:540px){
  .filename-input{ min-width: 100%; width:100% }
  .file-row{ flex-direction:column; align-items:flex-start; gap:8px }
  .file-status{ margin-left:0; max-width:100%; font-size:13px }
  .mode-buttons{ justify-content:center }
  .products-table thead th{ font-size:12px }
  .header h1{ font-size:18px }
}