:root {
  --bg: #0a0a0a;
  --bg2: #000000;
  --cd: #1a1a1a;
  --tx: #ffffff;
  --tx2: #a0a0a0;
  --tt: #b366ff;
  --accent: #b366ff;
  --accent-light: #22c55e;
  --accent-secondary: #22c55e;
  --sidebar-width: 280px;
}

body.l {
  --bg: #f0f0f0;
  --bg2: #e6e6e6;
  --cd: #dcdcdc;
  --tx: #5a5a4a;
  --tx2: #7a7a6a;
  --tt: #8b5cf6;
  --accent: #8b5cf6;
  --accent-light: #10b981;
  --accent-secondary: #10b981;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg2) 100%);
  color: var(--tx);
  transition: background 0.3s, color 0.3s;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(179, 102, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

body.l::before {
  background: radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.12) 0%, transparent 50%);
}

/* --- LAYOUT PRINCIPAL --- */
.container-wrapper {
  display: flex;
  min-height: 100vh;
  gap: 0;
}

/* --- SIDEBAR --- */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(26, 26, 26, 0.95);
  border-right: 2px solid var(--accent);
  padding: 40px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

body.l .sidebar {
  background: #f0f0f0;
}

.sidebar-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 2px solid var(--accent-secondary);
}

.profile-img {
  display: none;
}

.sidebar-header h1 {
  margin: 0 0 8px;
  font-size: 1.3rem;
  color: var(--accent);
}

.subtitle {
  margin: 0;
  color: var(--tx2);
  font-size: 0.9rem;
}

.sidebar-nav {
  flex: 1;
  margin-bottom: 30px;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin-bottom: 15px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--tx);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.sidebar-nav a:hover {
  background: rgba(179, 102, 255, 0.1);
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}

.sidebar-nav i {
  width: 20px;
  text-align: center;
  color: var(--accent);
}

.theme-btn {
  background: var(--accent);
  border: none;
  color: #000000;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: bold;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-size: 0.9rem;
}

body.l .theme-btn {
  color: white;
}

.theme-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(179, 102, 255, 0.5);
}

body.l .theme-btn:hover {
  box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}

/* --- MAIN CONTENT --- */
.main-content {
  flex: 1;
  padding: 60px;
  overflow-y: auto;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.content-section {
  margin-bottom: 60px;
  animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
}

.section-header h2 {
  background: rgba(179, 102, 255, 0.05);
  border: 1px solid rgba(179, 102, 255, 0.2);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 800;
}

.accent-line {
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.section-description {
  color: var(--tx2);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 20px;
}

/* --- SKILL LIST --- */
.skill-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.skill-list li {
  background: rgba(179, 102, 255, 0.05);
  border: 1px solid rgba(179, 102, 255, 0.2);
  padding: 15px;
  border-radius: 8px;
  color: var(--tx2);
  transition: all 0.3s ease;
}

body.l .skill-list li {
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.15);
}

.skill-list li:hover {
  background: rgba(179, 102, 255, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

body.l .skill-list li:hover {
  background: rgba(139, 92, 246, 0.12);
}

/* --- COURSES LIST --- */
.courses-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.courses-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  color: var(--tx2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.courses-list li:last-child {
  border-bottom: none;
}

.courses-list i {
  color: var(--accent);
  font-size: 1.1rem;
}

.courses-list li:hover {
  color: var(--accent);
  padding-left: 10px;
}

.down-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
  margin-left: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 1px dotted var(--accent);
}

.down-link:hover {
  color: var(--accent-light);
  border-bottom-color: var(--accent-light);
}

/* --- PROJECTS WRAPPER --- */
.projects-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
}

/* --- PROJECTS GRID --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(280px, 1fr));
  gap: 30px;
  flex: 1;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding: 10px 0;
}

/* --- PROJECTS NAVIGATION --- */
.projects-nav {
  background: var(--accent);
  border: none;
  color: #000000;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(179, 102, 255, 0.3);
}

.projects-nav:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(179, 102, 255, 0.5);
}

.projects-nav:active {
  transform: scale(0.95);
}

.projects-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.project-card {
  background: var(--cd);
  border: 1px solid rgba(179, 102, 255, 0.2);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

body.l .project-card {
  border: 1px solid rgba(139, 92, 246, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 25px rgba(179, 102, 255, 0.3);
  transform: translateY(-8px);
}

body.l .project-card:hover {
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.2);
}

.project-image {
  background: linear-gradient(135deg, rgba(179, 102, 255, 0.15) 0%, rgba(179, 102, 255, 0.05) 100%);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: var(--accent);
  border-bottom: 1px solid rgba(179, 102, 255, 0.2);
  position: relative;
  overflow: hidden;
}

body.l .project-image {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(5px);
}

.project-image:hover .project-overlay {
  opacity: 1;
}

.overlay-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.overlay-btn:hover {
  background: var(--accent-secondary);
  transform: scale(1.05);
}

.project-card h3 {
  margin: 0;
  padding: 20px 20px 10px;
  font-size: 1.2rem;
  color: var(--accent);
}

.project-card p {
  padding: 0 20px 20px;
  color: var(--tx2);
  margin: 0;
  flex: 1;
}

/* --- SOCIAL LINKS --- */
.social-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 30px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(179, 102, 255, 0.08);
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
  padding: 12px 24px;
  border-radius: 50px;
  border: 1px solid rgba(179, 102, 255, 0.3);
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

body.l .social-link {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.social-link:hover {
  transform: translateY(-5px);
  background: var(--accent);
  color: #000000;
  box-shadow: 0 5px 20px rgba(179, 102, 255, 0.5);
  border-color: var(--accent);
}

body.l .social-link:hover {
  color: white;
  box-shadow: 0 5px 20px rgba(139, 92, 246, 0.4);
}

.social-link.cv-highlight {
  background: var(--accent);
  color: #000000;
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(179, 102, 255, 0.6);
}

body.l .social-link.cv-highlight {
  color: white;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

.social-link.cv-highlight:hover {
  box-shadow: 0 5px 25px rgba(179, 102, 255, 0.7);
}

body.l .social-link.cv-highlight:hover {
  box-shadow: 0 5px 25px rgba(139, 92, 246, 0.6);
}

/* --- COPYRIGHT --- */
.copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 20px;
  font-size: 0.85rem;
  color: var(--tx2);
  text-align: center;
  margin-top: 30px;
}

.copyright p {
  margin: 0;
  opacity: 0.7;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .main-content {
    padding: 40px;
  }
  
  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
  
  .skill-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 70px;
  }
  
  .container-wrapper {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    padding: 20px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-right: none;
    border-bottom: 2px solid var(--accent);
  }
  
  .sidebar-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 20px;
  }
  
  .profile-img {
    width: 60px;
    height: 60px;
    margin-bottom: 0;
  }
  
  .sidebar-header h1 {
    font-size: 1rem;
  }
  
  .subtitle {
    display: none;
  }
  
  .sidebar-nav {
    margin-bottom: 0;
    flex: 1;
  }
  
  .sidebar-nav ul {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
  
  .sidebar-nav li {
    margin-bottom: 0;
  }
  
  .sidebar-nav a {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  
  .theme-btn {
    width: auto;
    padding: 8px 16px;
    font-size: 0.8rem;
  }
  
  .main-content {
    padding: 30px 20px;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .section-header h2 {
    font-size: 1.5rem;
  }
  
  .projects-wrapper {
    flex-direction: column;
    gap: 15px;
  }
  
  .projects-nav {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* --- SCROLLBAR CUSTOMIZADO --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(179, 102, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-light);
}
