/* style.css – redesign moderno e limpo */

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  min-height: 100vh;
  background-color: #f1f5f9;
  color: #1e293b;
}

/************************** SIDEBAR **************************/
.sidebar {
  width: 250px;
  background-color: #0f172a;
  color: #ffffff;
  padding: 30px 20px;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
}

.sidebar h2 {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.5rem;
  font-weight: 600;
}

.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar ul li { margin-bottom: 20px; }
.sidebar ul li a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  display: block;
  transition: all 0.3s ease;
}
.sidebar ul li a:hover { color: #38bdf8; padding-left: 5px; }
.sidebar ul li a.active {
  color: #38bdf8;
  font-weight: bold;
  border-left: 3px solid #38bdf8;
  padding-left: 12px;
}

/************************** MAIN **************************/
.main {
  margin-left: 270px;
  padding: 40px 60px;
  flex: 1;
  background-color: #f1f5f9;
  max-width: 1200px;
  margin-right: auto;
}

.main h1 {
  font-size: 2.2rem;
  margin-bottom: 20px;
  color: #0f172a;
  font-weight: 600;
}

.main p { line-height: 1.8; font-size: 1rem; max-width: 800px; }
.main a { color: #2563eb; text-decoration: none; border-bottom: 1px dashed #2563eb; }
.main a:hover { color: #1d4ed8; border-color: #1d4ed8; }

/************************** HORIZONTAL NAV inside portfolio **************************/
.portfolio-nav {
  display: flex;
  gap: 32px;
  margin: 10px 0 30px;
}
.portfolio-nav a {
  position: relative;
  font-weight: 500;
  color: #0f172a;
  text-decoration: none;
  padding-bottom: 4px;
  transition: color 0.2s ease;
}
.portfolio-nav a:hover,
.portfolio-nav a.active {
  color: #2563eb;
}
.portfolio-nav a:hover::after,
.portfolio-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: #2563eb;
  border-radius: 1px;
}

/************************** SECTION TITLES **************************/
.section-title {
  margin: 40px 0 20px;
  font-size: 1.6rem;
  color: #0f172a;
  border-left: 4px solid #0f172a;
  padding-left: 12px;
  width: 100%;
  max-width: 850px; /* mantém limite em telas grandes */
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
}

/************************** CARD **************************/
.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 25px;
  margin: 0 0 40px 0;
  width: 100%;
  border: 1px solid #e2e8f0;
}

.card h3 {
  font-size: 1.3rem;
  margin: 0 0 18px;
  color: #0f172a;
  font-weight: 600;
}

/********* profile card *********/
.card.profile-card { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.profile-card .profile-photo { flex: 1; max-width: 220px; }
.profile-card .profile-photo img { width: 100%; border-radius: 8px; }
.profile-card .profile-text { flex: 2; min-width: 250px; }

/********* Code box *********/
.code-box {
  background: #f7f7f9;
  border: 1px solid #e1e1e8;
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  font-family: Consolas, Menlo, Monaco, "Courier New", monospace;
  font-size: 0.92rem;
  line-height: 1.4;
  transition: box-shadow 0.2s ease;
}
.code-box:hover { box-shadow: 0 0 8px rgba(0,0,0,0.08); }
.code-box .func { color: #007acc; }
.code-box .comment { color: #6a737d; }
.code-box .number { color: #d14; }

/********* Performance table *********/
.perf-table { width: auto; border-collapse: collapse; margin: 1rem 0; }
.perf-table th, .perf-table td { padding: 6px 10px; font-size: 0.9rem; }
.perf-table th { background: #0f172a; color: #ffffff; text-align: left; }
.perf-table td.numeric { text-align: right; white-space: nowrap; font-family: Consolas, "Courier New", monospace; }
.perf-table tr:nth-child(even) { background: #f8fafc; }
.perf-table .improved { color: #16a34a; font-weight: 600; }
.perf-table .worse { color: #dc2626; font-weight: 600; }

/************************** RESPONSIVE **************************/
@media (max-width: 768px) {
  .sidebar { width: 100%; position: relative; box-shadow: none; }
  .main    { margin-left: 0; padding: 20px; max-width: 100%; }
  .portfolio-nav { gap: 16px; flex-wrap: wrap; }
  .card.profile-card { flex-direction: column; align-items: flex-start; }
  .profile-card .profile-photo { max-width: 100%; margin-bottom: 20px; }
  .profile-card .profile-text  { flex: 1; width: 100%; }
}

/* ---------- Back‑to‑top link ---------- */
.backtop { text-align: right; margin-top: 25px; }
.backtop a { color: #2563eb; font-size: 0.85rem; text-decoration: none; }
.backtop a:hover { color: #1d4ed8; text-decoration: underline; }

.intro {
  font-size: 1.05rem;
  margin: 0 0 25px;
  max-width: 800px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 600px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 6px;
  color: #0f172a;
}

.form-group input,
.form-group textarea {
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 1rem;
  background-color: #ffffff;
  color: #1e293b;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #38bdf8;
  outline: none;
}

button[type="submit"] {
  align-self: flex-start;
  background-color: #38bdf8;
  color: white;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button[type="submit"]:hover {
  background-color: #0ea5e9;
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 20px;
    text-align: center;
  }

  .main {
    margin-left: 0;
    padding: 20px;
  }

  .card {
    padding: 20px;
    margin: 15px 0;
  }

  .card img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
  }

  section.card {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
  }

  section.card > div {
    width: 100%;
  }
}
