@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.2);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);
    
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --border-radius-xl: 32px;
    
    --transition-fast: 0.2s ease-out;
    --transition-smooth: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

[data-theme='light'] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.1);
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
}

[data-theme='dark'] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: rgba(30, 41, 59, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.05);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    
    --border-color: #334155;
    --border-hover: #475569;
}

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

html {
  scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: all var(--transition-smooth);
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(245, 87, 108, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(67, 233, 123, 0.1) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header Styles */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    transition: all var(--transition-smooth);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.nav {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: all var(--transition-smooth);
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width var(--transition-smooth);
}

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

.nav a:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-container {
    position: relative;
}

.search-input {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: all var(--transition-smooth);
    width: 200px;
}

.search-input:focus {
    outline: none;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
    transform: scale(1.02);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.theme-toggle {
    padding: 0.5rem;
    border: none;
    border-radius: var(--border-radius-md);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-bounce);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-glow);
}

/* Main Content */
.main {
    padding: 4rem 0;
}

.section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60%;
    height: 4px;
    background: var(--secondary-gradient);
    border-radius: 2px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    position: relative;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-description {
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Age Animation */
.age-counter {
    display: inline-block;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Project Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-smooth);
    border: 1px solid var(--border-color);
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform var(--transition-smooth);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    filter: saturate(0.4);
    transition: all var(--transition-smooth);
    cursor: zoom-in;
}

.project-image:hover {
    filter: saturate(1.2);
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-md);
    background: var(--primary-gradient);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-bounce);
    position: relative;
    overflow: hidden;
}

.project-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
}

.project-button:hover::before {
    width: 300px;
    height: 300px;
}

.project-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.project-button:active {
    transform: translateY(0);
}

.not-finished {
    background: var(--warning-gradient) !important;
}

/* Info Section */
.info-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.profile-image {
    width: 100%;
    max-width: 300px;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-smooth);
}

.profile-image:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

/* Resources Section */
.resources-container {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.resource-category {
    margin-bottom: 2rem;
}

.resource-category h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.resource-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.resource-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    transition: all var(--transition-smooth);
    border: 1px solid var(--border-color);
}

.resource-link:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Posts Section */
.posts-container {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.coming-soon {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.posts-placeholder {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

/* Footer */
.footer {
    background: var(--primary-gradient);
    color: white;
    text-align: center;
    padding: 2rem 0;
    border-radius: var(--border-radius-lg);
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
}

/* Dialog Styles */
dialog {
    border: none;
    border-radius: var(--border-radius-lg);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);

    aspect-ratio: 16/9.7;
    width: 80%;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
}

dialog[open] {
    display: flex;
    align-self: center;
    justify-self: center;
    justify-content: center;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.viewer-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

#imageCanvas {
    max-height: 90%;
    max-width: 95%;
    border-radius: var(--border-radius-md);
    background: #000;
    cursor: grab;
}

.controls {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    padding: 0.75rem;
    border: none;
    border-radius: var(--border-radius-md);
    background: var(--primary-gradient);
    color: white;
    cursor: pointer;
    transition: all var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

/* Info Section */
.info-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.profile-image {
    width: 100%;
    max-width: 300px;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-smooth);
    justify-self: center;
}

.profile-image:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

/* Resources Section */
.resources-container {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.resource-category {
    margin-bottom: 2rem;
}

.resource-category:last-child {
    margin-bottom: 0;
}

.resource-category h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.resource-category h3 .material-symbols-outlined {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.2rem;
}

.resource-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.resource-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    transition: all var(--transition-smooth);
    border: 1px solid var(--border-color);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.resource-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    transition: left var(--transition-smooth);
    z-index: -1;
}

.resource-link:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.resource-link:hover::before {
    left: 0;
}

.resource-link .material-symbols-outlined {
    font-size: 1rem;
    transition: transform var(--transition-smooth);
}

.resource-link:hover .material-symbols-outlined {
    transform: scale(1.1);
}

/* Posts Section */
.posts-container {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.posts-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(102, 126, 234, 0.05),
        transparent,
        rgba(245, 87, 108, 0.05),
        transparent
    );
    animation: shimmer 6s infinite linear;
    z-index: 0;
}

.posts-container > * {
    position: relative;
    z-index: 1;
}

.posts-placeholder {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    box-shadow: var(--shadow-md);
    animation: pulse 2s infinite;
}

.posts-placeholder .material-symbols-outlined {
    font-size: 2rem;
}

.posts-container h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.coming-soon {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Footer Mejorado */
.footer {
    background: var(--primary-gradient);
    color: white;
    text-align: center;
    padding: 3rem 2rem;
    border-radius: var(--border-radius-lg);
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmer 3s infinite;
    z-index: 0;
}

.footer .container {
    position: relative;
    z-index: 1;
}

.footer p {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

/* Responsive Mejorado */
@media (max-width: 1024px) {
    .info-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .profile-image {
        max-width: 250px;
    }
}

@media (max-width: 768px) {
    .resources-container,
    .posts-container {
        padding: 1.5rem;
    }

    .resource-links {
        justify-content: center;
    }

    .resource-category h3 {
        justify-content: center;
        text-align: center;
    }

    .posts-container {
        padding: 2rem 1.5rem;
    }

    .posts-placeholder {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }

    .posts-placeholder .material-symbols-outlined {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .info-content {
        gap: 1.5rem;
    }

    .profile-image {
        max-width: 200px;
    }

    .resource-links {
        flex-direction: column;
        align-items: center;
    }

    .resource-link {
        width: 100%;
        justify-content: center;
        max-width: 280px;
    }

    .resources-container,
    .posts-container {
        padding: 1rem;
    }

    .footer {
        padding: 2rem 1rem;
    }
}

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

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        gap: 1rem;
    }

    .search-input {
        width: 150px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .info-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .resource-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .project-content {
        padding: 1rem;
    }
}