/* Design System Variables */
:root {
  --background: oklch(0.9232 0.0026 48.7171);
  --foreground: oklch(0.2795 0.0368 260.0310);
  --card: oklch(0.9699 0.0013 106.4238);
  --card-foreground: oklch(0.2795 0.0368 260.0310);
  --popover: oklch(0.9699 0.0013 106.4238);
  --popover-foreground: oklch(0.2795 0.0368 260.0310);
  --primary: oklch(0.5854 0.2041 277.1173);
  --primary-foreground: oklch(1.0000 0 0);
  --secondary: oklch(0.8687 0.0043 56.3660);
  --secondary-foreground: oklch(0.4461 0.0263 256.8018);
  --muted: oklch(0.9232 0.0026 48.7171);
  --muted-foreground: oklch(0.5510 0.0234 264.3637);
  --accent: oklch(0.9376 0.0260 321.9388);
  --accent-foreground: oklch(0.3729 0.0306 259.7328);
  --destructive: oklch(0.6368 0.2078 25.3313);
  --destructive-foreground: oklch(1.0000 0 0);
  --border: oklch(0.8687 0.0043 56.3660);
  --input: oklch(0.8687 0.0043 56.3660);
  --ring: oklch(0.5854 0.2041 277.1173);
  --chart-1: oklch(0.5854 0.2041 277.1173);
  --chart-2: oklch(0.5106 0.2301 276.9656);
  --chart-3: oklch(0.4568 0.2146 277.0229);
  --chart-4: oklch(0.3984 0.1773 277.3662);
  --chart-5: oklch(0.3588 0.1354 278.6973);
  --sidebar: oklch(0.8687 0.0043 56.3660);
  --sidebar-foreground: oklch(0.2795 0.0368 260.0310);
  --sidebar-primary: oklch(0.5854 0.2041 277.1173);
  --sidebar-primary-foreground: oklch(1.0000 0 0);
  --sidebar-accent: oklch(0.9376 0.0260 321.9388);
  --sidebar-accent-foreground: oklch(0.3729 0.0306 259.7328);
  --sidebar-border: oklch(0.8687 0.0043 56.3660);
  --sidebar-ring: oklch(0.5854 0.2041 277.1173);
  --font-sans: Plus Jakarta Sans, sans-serif;
  --font-serif: Lora, serif;
  --font-mono: Roboto Mono, monospace;
  --radius: 1.25rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --shadow-2xs: 2px 2px 10px 4px hsl(240 4% 60% / 0.09);
  --shadow-xs: 2px 2px 10px 4px hsl(240 4% 60% / 0.09);
  --shadow-sm: 2px 2px 10px 4px hsl(240 4% 60% / 0.18), 2px 1px 2px 3px hsl(240 4% 60% / 0.18);
  --shadow: 2px 2px 10px 4px hsl(240 4% 60% / 0.18), 2px 1px 2px 3px hsl(240 4% 60% / 0.18);
  --shadow-md: 2px 2px 10px 4px hsl(240 4% 60% / 0.18), 2px 2px 4px 3px hsl(240 4% 60% / 0.18);
  --shadow-lg: 2px 2px 10px 4px hsl(240 4% 60% / 0.18), 2px 4px 6px 3px hsl(240 4% 60% / 0.18);
  --shadow-xl: 2px 2px 10px 4px hsl(240 4% 60% / 0.18), 2px 8px 10px 3px hsl(240 4% 60% / 0.18);
  --shadow-2xl: 2px 2px 10px 4px hsl(240 4% 60% / 0.45);
  --tracking-normal: 0em;
  --spacing: 0.25rem;
}

.dark {
  --background: oklch(0.2244 0.0074 67.4370);
  --foreground: oklch(0.9288 0.0126 255.5078);
  --card: oklch(0.2801 0.0080 59.3379);
  --card-foreground: oklch(0.9288 0.0126 255.5078);
  --popover: oklch(0.2801 0.0080 59.3379);
  --popover-foreground: oklch(0.9288 0.0126 255.5078);
  --primary: oklch(0.6801 0.1583 276.9349);
  --primary-foreground: oklch(0.2244 0.0074 67.4370);
  --secondary: oklch(0.3359 0.0077 59.4197);
  --secondary-foreground: oklch(0.8717 0.0093 258.3382);
  --muted: oklch(0.2801 0.0080 59.3379);
  --muted-foreground: oklch(0.7137 0.0192 261.3246);
  --accent: oklch(0.3896 0.0074 59.4734);
  --accent-foreground: oklch(0.8717 0.0093 258.3382);
  --destructive: oklch(0.6368 0.2078 25.3313);
  --destructive-foreground: oklch(0.2244 0.0074 67.4370);
  --border: oklch(0.3359 0.0077 59.4197);
  --input: oklch(0.3359 0.0077 59.4197);
  --ring: oklch(0.6801 0.1583 276.9349);
  --chart-1: oklch(0.6801 0.1583 276.9349);
  --chart-2: oklch(0.5854 0.2041 277.1173);
  --chart-3: oklch(0.5106 0.2301 276.9656);
  --chart-4: oklch(0.4568 0.2146 277.0229);
  --chart-5: oklch(0.3984 0.1773 277.3662);
  --sidebar: oklch(0.3359 0.0077 59.4197);
  --sidebar-foreground: oklch(0.9288 0.0126 255.5078);
  --sidebar-primary: oklch(0.6801 0.1583 276.9349);
  --sidebar-primary-foreground: oklch(0.2244 0.0074 67.4370);
  --sidebar-accent: oklch(0.3896 0.0074 59.4734);
  --sidebar-accent-foreground: oklch(0.8717 0.0093 258.3382);
  --sidebar-border: oklch(0.3359 0.0077 59.4197);
  --sidebar-ring: oklch(0.6801 0.1583 276.9349);
  --font-sans: Plus Jakarta Sans, sans-serif;
  --font-serif: Lora, serif;
  --font-mono: Roboto Mono, monospace;
  --radius: 1.25rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --shadow-2xs: 2px 2px 10px 4px hsl(0 0% 0% / 0.09);
  --shadow-xs: 2px 2px 10px 4px hsl(0 0% 0% / 0.09);
  --shadow-sm: 2px 2px 10px 4px hsl(0 0% 0% / 0.18), 2px 1px 2px 3px hsl(0 0% 0% / 0.18);
  --shadow: 2px 2px 10px 4px hsl(0 0% 0% / 0.18), 2px 1px 2px 3px hsl(0 0% 0% / 0.18);
  --shadow-md: 2px 2px 10px 4px hsl(0 0% 0% / 0.18), 2px 2px 4px 3px hsl(0 0% 0% / 0.18);
  --shadow-lg: 2px 2px 10px 4px hsl(0 0% 0% / 0.18), 2px 4px 6px 3px hsl(0 0% 0% / 0.18);
  --shadow-xl: 2px 2px 10px 4px hsl(0 0% 0% / 0.18), 2px 8px 10px 3px hsl(0 0% 0% / 0.18);
  --shadow-2xl: 2px 2px 10px 4px hsl(0 0% 0% / 0.45);
  --tracking-normal: 0em;
  --spacing: 0.25rem;
}

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

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--foreground);
    background: var(--background);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out;
}

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

/* Header - Perfil principal */
.profile-header {
    background: var(--secondary);
    color: var(--secondary-foreground);
    text-align: left;
    padding: 25px 40px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 30px;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.05"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.05"/><circle cx="50" cy="10" r="1" fill="white" opacity="0.03"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--primary);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: var(--primary-foreground);
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

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

.profile-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.profile-header h1 {
    font-size: 3em;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    margin-top: 0;
}

.profile-header h2 {
    font-size: 1.3em;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.tagline {
    font-size: 1.1em;
    opacity: 0.8;
    font-style: italic;
    max-width: 600px;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Contenido principal */
.content {
    padding: 60px 40px;
}

section {
    margin-bottom: 50px;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

section h3 {
    font-size: 1.8em;
    color: var(--foreground);
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 15px;
}

section h3 i {
    color: var(--primary);
    font-size: 0.9em;
}

/* Sección Sobre mí */
.about p {
    font-size: 1.1em;
    text-align: justify;
    color: var(--muted-foreground);
    line-height: 1.8;
    background: var(--muted);
    padding: 25px;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary);
}

/* Grid de habilidades */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.skill-item {
    background: var(--secondary);
    padding: 25px;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--secondary-foreground);
    position: relative;
}

.skill-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    background: var(--primary);
    color: var(--primary-foreground);
}

.skill-item i {
    font-size: 2.5em;
    color: var(--primary);
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.skill-item:hover i {
    color: var(--primary-foreground);
}

.skill-item span {
    font-size: 1.1em;
    font-weight: 600;
    display: block;
}

/* Tooltip styles */
.skill-item::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--foreground);
    color: var(--card);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85em;
    line-height: 1.4;
    white-space: nowrap;
    max-width: 300px;
    white-space: normal;
    width: max-content;
    max-width: 280px;
    text-align: left;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    margin-bottom: 8px;
}

.skill-item::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--foreground);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    margin-bottom: 2px;
}

.skill-item:hover::before,
.skill-item:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Experiencia */
.experience-item {
    background: var(--muted);
    padding: 30px;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary);
    margin-bottom: 20px;
}

.experience-item h4 {
    font-size: 1.4em;
    color: var(--foreground);
    margin-bottom: 10px;
}

.period {
    color: var(--muted-foreground);
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1em;
}

.experience-item ul {
    list-style: none;
    padding-left: 0;
}

.experience-item li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: var(--muted-foreground);
}

.experience-item li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
    font-size: 1.1em;
}

/* Información de contacto */
.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.contact-item {
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 20px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.contact-item:visited {
    color: var(--primary-foreground);
}

.contact-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    background: var(--secondary);
    color: var(--secondary-foreground);
}

.contact-item i {
    font-size: 1.5em;
    min-width: 25px;
}

.contact-item span {
    font-weight: 500;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Footer */
footer {
    background: var(--secondary);
    color: var(--secondary-foreground);
    text-align: center;
    padding: 30px;
    font-size: 0.95em;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 15px;
    }
    
    .profile-header {
        padding: 40px 20px;
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .profile-content {
        align-items: center;
    }
    
    .tagline {
        max-width: 100%;
    }
    
    .profile-header h1 {
        font-size: 2.2em;
    }
    
    .content {
        padding: 40px 20px;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-info {
        grid-template-columns: 1fr;
    }
    
    section h3 {
        font-size: 1.5em;
    }
    
    .skill-item::before {
        max-width: 250px;
        font-size: 0.8em;
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .profile-header h1 {
        font-size: 1.8em;
    }
    
    .profile-header h2 {
        font-size: 1.1em;
    }
    
    .profile-image {
        width: 120px;
        height: 120px;
        font-size: 40px;
    }
    
    .content {
        padding: 30px 15px;
    }
    
    .about p {
        padding: 20px;
    }
    
    .profile-header {
        gap: 15px;
    }
}

/* Animaciones adicionales */
.skill-item {
    animation: slideInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.skill-item:nth-child(1) { animation-delay: 0.1s; }
.skill-item:nth-child(2) { animation-delay: 0.2s; }
.skill-item:nth-child(3) { animation-delay: 0.3s; }
.skill-item:nth-child(4) { animation-delay: 0.4s; }
.skill-item:nth-child(5) { animation-delay: 0.5s; }
.skill-item:nth-child(6) { animation-delay: 0.6s; }

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

.contact-item {
    animation: slideInLeft 0.6s ease-out;
    animation-fill-mode: both;
}

.contact-item:nth-child(1) { animation-delay: 0.1s; }
.contact-item:nth-child(2) { animation-delay: 0.2s; }
.contact-item:nth-child(3) { animation-delay: 0.3s; }
.contact-item:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
