/* ===========================================================
   LAYOUT.CSS - AWS Developer Course Schedule

   Estrutura de layout (header, footer, containers, search, tables)
   @author Tomas Alric - Cloud Basics
   @version 2.0
   =========================================================== */

/* ===========================================================
   LAYOUT
   =========================================================== */

main {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
}

#modules-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ===========================================================
   HEADER
   =========================================================== */

header {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  color: white;
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h60v60H0z" fill="none"/><path d="M30 0l30 30-30 30L0 30z" fill="rgba(255,255,255,0.03)"/></svg>')
    repeat;
  opacity: 0.5;
}

header > * {
  position: relative;
  z-index: 1;
}

.header-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.6s ease-out;
}

.logo {
  height: 60px;
  width: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05) rotate(2deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.brand-name {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.brand-tagline {
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.header-content {
  animation: fadeIn 0.8s ease-out;
}

header h1 {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

header p {
  margin: 0.75rem auto 0;
  font-size: 1rem;
  opacity: 0.95;
  max-width: 600px;
  font-weight: 400;
}

/* ===========================================================
   SEARCH BOX
   =========================================================== */

.search-container {
  margin-bottom: 1.5rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--primary);
  pointer-events: none;
  z-index: 1;
}

#search-input {
  width: 100%;
  padding: 0.875rem 3rem;
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  background-color: white;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.15);
}

#search-input:focus {
  outline: none;
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.2);
}

#search-input::placeholder {
  color: #475569;
  font-weight: 500;
  opacity: 1;
}

.clear-btn {
  position: absolute;
  right: 1rem;
  background: var(--primary);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: white;
  box-shadow: 0 2px 4px rgba(13, 148, 136, 0.3);
}

.clear-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(13, 148, 136, 0.4);
}

.clear-btn:active {
  transform: scale(0.95);
}

.search-results-count {
  margin-top: 0.75rem;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(
    135deg,
    rgba(13, 148, 136, 0.15) 0%,
    rgba(13, 148, 136, 0.08) 100%
  );
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  color: var(--primary-dark);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: left;
  display: none;
}

.search-results-count.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.highlight {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #1e293b;
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
}

/* ===========================================================
   CONTROLS & FILTERS
   =========================================================== */

.controls {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.controls-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.controls label {
  font-weight: 700;
  color: var(--secondary);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.controls select {
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-md);
  background-color: white;
  color: #475569;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.controls select:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
  transform: translateY(-1px);
  background-color: #f8fafc;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%230d9488' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.controls select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
}

.controls-right {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  border: 2px solid var(--primary);
  color: white;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.3);
}

.action-btn svg {
  transition: transform 0.2s ease;
}

.action-btn:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #0a5f58 100%);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.4);
}

.action-btn:hover svg {
  transform: scale(1.15);
}

.action-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.3);
}

.action-btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.2);
}

/* ===========================================================
   TABLES
   =========================================================== */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

thead {
  background: linear-gradient(180deg, #0d9488 0%, #0f766e 100%);
}

th {
  padding: 1rem 0.75rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: white;
  vertical-align: middle;
}

th:first-child {
  width: 50px;
  text-align: center;
  padding: 0.5rem;
}

td {
  padding: 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.95rem;
  color: var(--secondary);
  vertical-align: middle;
}

td:first-child {
  text-align: center;
  padding: 0.5rem;
  width: 50px;
}

td:nth-child(2) {
  font-weight: 600;
}

tbody tr:nth-child(even) {
  background-color: rgba(13, 148, 136, 0.02);
}

tbody tr:hover {
  background-color: rgba(13, 148, 136, 0.08);
  transition: background-color 0.2s ease;
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ===========================================================
   FOOTER
   =========================================================== */

footer {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #cbd5e1;
  padding: 2rem 1rem;
  margin-top: 4rem;
  border-top: 3px solid var(--primary);
}

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

.footer-logo {
  height: 40px;
  width: auto;
  opacity: 0.9;
  filter: brightness(1.2);
  margin-bottom: 0.5rem;
}

footer p {
  margin: 0;
  font-size: 0.95rem;
  color: #cbd5e1;
}

footer strong {
  color: white;
  font-weight: 600;
}

.footer-course {
  font-size: 0.85rem;
  color: #94a3b8;
  font-style: italic;
}
