/* ==========================================================================
   DDS SENAI-SP - Design System & Modern Styling
   Autoria: Prof. Esp. Leandro Gaudio Rosa
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --primary: #e30613; /* SENAI Red */
  --primary-hover: #b8030e;
  --primary-light: #fef2f2;
  --dark: #0f172a;
  --dark-surface: #1e293b;
  --gray-100: #f8fafc;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --white: #ffffff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.12), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #f1f5f9;
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Branding */
.navbar {
  background: var(--dark-surface);
  color: var(--white);
  padding: 1rem 2rem;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 4px solid var(--primary);
}

.navbar-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--white);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  padding: 0;
  border-radius: 0 !important;
}

.brand-logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
  border-radius: 0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.brand-info h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.brand-info p {
  font-size: 0.85rem;
  color: var(--gray-300);
}

.author-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.825rem;
  color: #e2e8f0;
}

.author-tag svg {
  color: var(--primary);
}

/* Layout Container */
.container {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  width: 100%;
  flex: 1;
}

/* Header Action Banner */
.page-header {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  border: 1px solid var(--gray-200);
}

.header-title h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.year-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid rgba(227, 6, 19, 0.2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Notice Card para Alunos */
.notice-card {
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-left: 6px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.notice-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #873800;
  margin-bottom: 0.4rem;
  letter-spacing: 0.5px;
}

.notice-icon {
  font-size: 1.2rem;
}

.notice-body {
  color: #612500;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
}

/* Controls & Filters */
.search-box {
  position: relative;
  min-width: 280px;
}

.search-box input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.15);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-600);
  pointer-events: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.925rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: var(--transition);
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--gray-200);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background-color: var(--gray-300);
  color: var(--gray-900);
}

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

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

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

.btn-danger:hover {
  background-color: #dc2626;
}

/* Container dos botões de ação Editar e Excluir */
.action-buttons {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.action-buttons .btn {
  padding: 0.45rem 0.85rem;
  font-size: 0.825rem;
  white-space: nowrap;
  line-height: 1.2;
}

/* Data Table Card */
.table-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.dds-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.dds-table th {
  background: var(--dark-surface);
  color: var(--white);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.dds-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.95rem;
  vertical-align: middle;
}

.dds-table tbody tr {
  transition: var(--transition);
}

.dds-table tbody tr:hover {
  background-color: var(--gray-100);
}

/* Fade Out Animation para exclusão de linhas */
tr.row-fade-out {
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
  opacity: 0 !important;
  background-color: #fee2e2 !important;
  transform: translateX(30px);
}

.col-num {
  width: 90px;
  text-align: center;
}

.col-squad {
  width: 220px;
}

.num-badge {
  display: inline-block;
  width: 38px;
  height: 38px;
  line-height: 38px;
  background: var(--gray-200);
  color: var(--gray-900);
  font-weight: 700;
  border-radius: 50%;
  text-align: center;
  font-size: 0.9rem;
}

/* Squad Badges (1 to 8) */
.squad-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.squad-1 { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.squad-2 { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.squad-3 { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.squad-4 { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.squad-5 { background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; }
.squad-6 { background: #cffafe; color: #155e75; border: 1px solid #67e8f9; }
.squad-7 { background: #fce7f3; color: #9d174d; border: 1px solid #fbcfe8; }
.squad-8 { background: #e0e7ff; color: #3730a3; border: 1px solid #a5b4fc; }

/* Modal de Edição */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  padding: 1.75rem;
  border-top: 5px solid var(--primary);
  animation: modalFadeIn 0.2s ease-out;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 0.75rem;
}

.modal-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  color: var(--gray-900);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--gray-600);
  cursor: pointer;
  padding: 0.25rem;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--primary);
}

/* Admin Dashboard Cards & Forms */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  color: var(--gray-900);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--gray-700);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 140px;
}

.batch-hint {
  font-size: 0.825rem;
  color: var(--gray-600);
  margin-top: 0.4rem;
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.alert-danger {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* Login Page Styling */
.login-body {
  background: linear-gradient(135deg, var(--dark) 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  border-top: 5px solid var(--primary);
}

.login-header {
  text-align: center;
  padding: 2.5rem 2rem 1.5rem 2rem;
}

.login-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  color: var(--gray-900);
}

.login-form {
  padding: 0 2rem 2.5rem 2rem;
}

/* Footer */
.footer {
  background: var(--dark);
  color: var(--gray-300);
  padding: 2rem 1.5rem;
  margin-top: auto;
  text-align: center;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.footer strong {
  color: var(--white);
}

/* Print Styles */
@media print {
  .navbar, .header-actions, .search-box, .btn, .footer, .admin-only {
    display: none !important;
  }
  
  body {
    background: #fff;
    color: #000;
  }
  
  .container {
    max-width: 100%;
    margin: 0;
    padding: 0;
  }
  
  .page-header {
    box-shadow: none;
    border: none;
    padding: 0 0 1rem 0;
    margin-bottom: 1rem;
  }
  
  .table-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .dds-table th {
    background: #222 !important;
    color: #fff !important;
  }
  
  .squad-badge {
    border: 1px solid #999 !important;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .navbar-container, .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .header-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .search-box {
    width: 100%;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
}
