/* --- Base Variables --- */
:root {
  /* Light Theme */
  --bg-color: #f8fafc;
  --surface-color: #ffffff;
  --text-color: #0f172a;
  --text-muted: #475569;
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.5);
  --border-color: #e2e8f0;
  --header-bg: rgba(255, 255, 255, 0.85);
  
  /* Utilities */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px var(--primary-glow);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-color: #0f172a;
  --surface-color: #1e293b;
  --text-color: #f8fafc;
  --text-muted: #94a3b8;
  --primary-color: #60a5fa;
  --primary-hover: #93c5fd;
  --primary-glow: rgba(96, 165, 250, 0.4);
  --border-color: #334155;
  --header-bg: rgba(15, 23, 42, 0.85);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

/* --- Global Reset & Typography --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

/* Typography */
h1, h2, h3, h4 {
  color: var(--text-color);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

p {
  margin-bottom: 1.25rem;
}

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

main {
  min-height: calc(100vh - 160px);
  padding: 60px 0;
  animation: fadeIn 0.8s ease-out forwards;
}

/* --- Header & Navigation --- */
header {
  position: sticky;
  top: 0;
  background-color: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: var(--transition);
}

main {
  margin-top: 40px;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent; /* Fallback */
}

/* Mobile Menu Button */
.menu-toggle {
  display: block;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1001;
}

/* Nav Links - Mobile First */
.nav-wrapper {
  position: fixed;
  top: 0;
  
  right: 0; transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 250px;
  height: 100vh;
  background-color: var(--surface-color);
  box-shadow: -5px 0 25px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  padding: 100px 20px 20px;
  
  z-index: 999;
}

.nav-wrapper.active {
  transform: translateX(0);
  
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-links a {
  color: var(--text-color);
  font-weight: 600;
  font-size: 1.1rem;
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
}

/* Header Controls (Theme + Nav) */
.header-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.theme-toggle {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-color);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
  transform: rotate(15deg) scale(1.1);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* --- Components --- */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: #ffffff !important;
  border-radius: var(--radius-full);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px var(--primary-glow);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9rem;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text-color) !important;
  border: 2px solid var(--border-color);
  box-shadow: none;
}

.btn-outline:hover {
  border-color: var(--primary-color);
  color: var(--primary-color) !important;
  background: transparent;
  transform: translateY(-3px);
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25D366, #128C7E);
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp:hover {
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.6);
}

/* Floating WhatsApp Button */
.floating-wa {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: #25D366;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 35px;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.5);
  z-index: 100;
  transition: var(--transition);
  animation: pulse 2s infinite;
}

.floating-wa:hover {
  transform: scale(1.1) rotate(-10deg);
  color: white;
}

/* Cards */
.card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 30px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

/* --- Page Specific Styles --- */

/* Hero Section */
.hero {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 40px;
  text-align: center;
}

.hero-content {
  flex: 1;
}

.hero-subtitle {
  font-size: 1.2rem;
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
  justify-content: center;
}

.hero-image {
  flex: 1;
  position: relative;
}

.hero-image::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  border-radius: 50%;
  z-index: -1;
  opacity: 0.5;
  filter: blur(20px);
  animation: pulse 4s infinite alternate;
}

.hero-image img {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface-color);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.hero-image:hover img {
  transform: scale(1.05);
}

/* About Layout */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-top: 40px;
}

.timeline-item {
  position: relative;
  padding-left: 30px;
  margin-bottom: 30px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-glow);
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 25px;
  bottom: -20px;
  width: 2px;
  background-color: var(--border-color);
}

.timeline-item:last-child::after {
  display: none;
}

/* Expertise Grid */
.expertise-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
  margin-top: 40px;
}

.skill-icon {
  font-size: 3rem;
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin-bottom: 15px;
  transition: var(--transition);
}

.card:hover .skill-icon {
  transform: scale(1.2) rotate(5deg);
}

/* Contact Section */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-top: 40px;
}

.contact-method {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  transition: var(--transition);
}

.contact-method:hover {
  transform: translateX(10px);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.contact-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
  border-radius: 50%;
  font-size: 1.5rem;
}

/* Portfolio Cards */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.portfolio-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 25px 20px;
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-color);
}

.portfolio-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Social Share Links */
.social-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 60px;
  margin-bottom: 20px;
  padding-top: 30px;
  border-top: 1px dashed var(--border-color);
}

.social-share span {
  font-weight: 600;
  margin-right: 10px;
  color: var(--text-color);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  transition: var(--transition);
  cursor: pointer;
  font-size: 1.1rem;
}

.share-btn:hover {
  transform: translateY(-3px);
  color: #fff;
}

.share-btn.copy:hover { background-color: var(--text-color); border-color: var(--text-color); }
.share-btn.twitter:hover { background-color: #1DA1F2; border-color: #1DA1F2; }
.share-btn.facebook:hover { background-color: #1877F2; border-color: #1877F2; }
.share-btn.linkedin:hover { background-color: #0A66C2; border-color: #0A66C2; }
.share-btn.whatsapp:hover { background-color: #25D366; border-color: #25D366; }

/* Legal Text Container */
.legal-content {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 40px;
  margin-top: 40px;
  box-shadow: var(--shadow-sm);
  color: var(--text-color);
}

.legal-content h2 {
  color: var(--primary-color);
  margin-top: 30px;
  margin-bottom: 15px;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p {
  margin-bottom: 15px;
  line-height: 1.8;
  color: var(--text-muted);
}

.legal-content ul {
  margin-bottom: 20px;
  padding-left: 20px;
  color: var(--text-muted);
}

.legal-content li {
  margin-bottom: 8px;
}

/* Footer */
footer {
  padding: 50px 0 20px;
  border-top: 1px solid var(--border-color);
  background-color: var(--surface-color);
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--text-color);
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.footer-col ul a:hover {
  color: var(--primary-color);
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: var(--transition);
  font-size: 1.1rem;
}

.footer-social a:hover {
  background-color: var(--primary-color);
  color: #fff;
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Staggered animation for grid items */
.card {
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }


/* --- Desktop Breakpoints --- */
@media (min-width: 768px) {
  h1 { font-size: 3.5rem; }
  
  .menu-toggle {
    display: none;
  }
  
  .nav-wrapper {
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
    padding: 0;
    flex-direction: row;
    align-items: center;
  }
  
  .nav-links {
    flex-direction: row;
    gap: 5px;
  }
  
  .nav-links a {
    padding: 8px 16px;
    font-size: 1rem;
  }

  .nav-links a.active {
    background-color: transparent;
    border-bottom: 2px solid var(--primary-color);
    border-radius: 0;
  }

  .hero {
    flex-direction: row;
    text-align: left;
    padding: 40px 0;
  }
  
  .hero-actions {
    flex-direction: row;
    justify-content: flex-start;
  }
  
  .hero-image img {
    width: 350px;
    height: 350px;
  }
  
  .about-grid {
    grid-template-columns: 2fr 1fr;
  }
  
  .expertise-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
  
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Fix for mobile menu wrapper on desktop */
@media (min-width: 768px) {
  .nav-wrapper {
    transform: none !important;
  }
}

/* Contact Grid Enhancements */
.contact-grid.max-w-800 {
  max-width: 800px;
  margin: 0 auto;
}
.contact-card-link {
  text-decoration: none;
  color: inherit;
}
.contact-method.contact-method-center {
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 40px;
}
.contact-icon.whatsapp-icon {
  width: 80px;
  height: 80px;
  background-color: rgba(37, 211, 102, 0.1);
  color: #25D366;
}
.contact-icon.linkedin-icon {
  width: 80px;
  height: 80px;
  background-color: rgba(10, 102, 194, 0.1);
  color: #0a66c2;
}
.contact-title {
  margin-bottom: 5px;
}
.contact-subtitle {
  margin-bottom: 20px;
}
.btn.btn-linkedin {
  background: #0a66c2;
}

/* Utilities */
.text-highlight {
  color: var(--primary-color);
}
.text-center-max-700 {
  max-width: 700px;
  margin: 0 auto 50px;
}
.text-center-max-600 {
  max-width: 600px;
  margin: 0 auto 50px;
}
.text-center-max-800 {
  max-width: 800px;
  margin: 0 auto 50px;
}
.timeline-title {
  margin-left: 30px;
}

/* Skills Table and Lists */
.skills-container {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.skills-category {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.skills-category:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.skills-category h2 {
  margin-bottom: 20px;
  color: var(--primary-color);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
  font-size: 1.5rem;
}

.skills-table {
  width: 100%;
  border-collapse: collapse;
}

.skills-table th, .skills-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.skills-table th {
  font-weight: 600;
  color: var(--text-color);
  width: 40%;
}

.skills-table td {
  color: var(--text-muted);
}

.skills-table tr:last-child th,
.skills-table tr:last-child td {
  border-bottom: none;
}

.stars {
  color: #fbbf24;
  letter-spacing: 2px;
  display: inline-block;
  min-width: 120px;
}

.stars-empty {
  color: var(--border-color);
}

.years-exp {
  font-weight: 500;
  color: var(--text-color);
  text-align: right;
  width: 60px;
  display: inline-block;
}

@media (max-width: 768px) {
  .skills-table th, .skills-table td {
    display: block;
    width: 100%;
    padding: 8px 0;
  }
  
  .skills-table th {
    border-bottom: none;
    padding-bottom: 0;
  }
  
  .skills-table td {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

footer ul li svg, footer ul li i {
    margin-right: 8px;
}
