/**
 * AAN-Personal Portfolio Styles
 * Developer: Angel Luis Duran
 * Following AAN unified design system
 */

/* ========================================
   RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: var(--font-normal);
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all var(--transition-base);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-bold);
    line-height: 1.2;
    color: var(--gray-900);
    margin-bottom: var(--space-md);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
    margin-bottom: var(--space-md);
    color: var(--gray-700);
}

/* ========================================
   LAYOUT UTILITIES
   ======================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-wide {
    max-width: 1400px;
}

.section {
    padding: var(--space-3xl) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--space-2xl);
    font-size: var(--text-4xl);
    font-weight: var(--font-black);
    color: var(--gray-900);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--gradient-primary);
    margin: var(--space-md) auto 0;
    border-radius: var(--radius-full);
}

/* ========================================
   NAVIGATION
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: var(--z-fixed);
    transition: all var(--transition-base);
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
}

.navbar-brand {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--primary);
}

.navbar-menu {
    display: flex;
    gap: var(--space-xl);
    list-style: none;
}

.navbar-menu a {
    font-weight: var(--font-medium);
    color: var(--gray-700);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.navbar-menu a:hover {
    color: var(--primary);
    background: var(--gray-100);
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--gray-700);
    background: linear-gradient(to bottom, var(--white), var(--gray-50));
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-lg);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.lang-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(220, 38, 38, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lang-btn .fi {
    font-size: 18px;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    position: relative;
    z-index: 1;
}

.lang-btn span:last-child {
    position: relative;
    z-index: 1;
}

.lang-btn:hover::before {
    opacity: 1;
}

.lang-btn:hover {
    color: var(--primary);
    background: linear-gradient(to bottom, var(--white), var(--gray-100));
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(220, 38, 38, 0.2), 0 3px 6px rgba(0, 0, 0, 0.1);
}

.lang-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

/* Active State - Current Language */
.lang-btn.active {
    color: var(--white);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4), 0 2px 6px rgba(220, 38, 38, 0.3);
    transform: translateY(0);
}

.lang-btn.active::before {
    display: none;
}

.lang-btn.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.lang-btn.active:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #991B1B 100%);
    border-color: #991B1B;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.5), 0 3px 8px rgba(220, 38, 38, 0.4);
}

.lang-btn.active .fi {
    filter: brightness(1.1);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-lg);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-lg {
    padding: 16px 32px;
    font-size: var(--text-lg);
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-hero);
    color: var(--white);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h60v60H0z" fill="none"/><path d="M30 0v60M0 30h60" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-image {
    width: 180px;
    height: 180px;
    border-radius: var(--radius-full);
    border: 6px solid var(--white);
    box-shadow: var(--shadow-2xl);
    margin: 0 auto var(--space-xl);
    object-fit: cover;
    opacity: 0;
    animation: simpleFade 0.5s ease-out forwards;
}

.hero-title {
    font-size: var(--text-5xl);
    font-weight: var(--font-black);
    margin-bottom: var(--space-sm);
    color: var(--white);
}

.hero-subtitle {
    font-size: var(--text-2xl);
    font-weight: var(--font-medium);
    margin-bottom: var(--space-md);
    color: var(--white);
    opacity: 0.95;
}

.hero-description {
    font-size: var(--text-lg);
    margin-bottom: var(--space-2xl);
    color: var(--white);
    opacity: 0.9;
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

.hero-cta .btn {
    background: var(--white);
    color: var(--primary);
}

.hero-cta .btn:hover {
    background: var(--gray-100);
}

.hero-cta .btn-outline {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}

.hero-cta .btn-outline:hover {
    background: var(--white);
    color: var(--primary);
}

/* ========================================
   PROJECTS SECTION
   ======================================== */
.projects {
    background: var(--white);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
}

.project-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
}

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

.project-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--gradient-primary);
}

.project-card-body {
    padding: var(--space-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-card-logo {
    width: 60px;
    height: 60px;
    margin-bottom: var(--space-md);
    object-fit: contain;
}

.project-card-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-sm);
    color: var(--gray-900);
}

.project-card-description {
    font-size: var(--text-base);
    color: var(--gray-600);
    margin-bottom: var(--space-lg);
    flex: 1;
    line-height: 1.7;
}

.project-card-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.tech-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--white);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.project-card-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--primary);
    font-weight: var(--font-semibold);
    transition: all var(--transition-base);
}

.project-card-link:hover {
    gap: var(--space-md);
}

/* ========================================
   SKILLS SECTION
   ======================================== */
.skills {
    background: var(--gray-100);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
}

.skill-category {
    background: var(--white);
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.skill-category-title {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--primary);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.skill-list {
    list-style: none;
}

.skill-list li {
    padding: var(--space-sm) 0;
    color: var(--gray-700);
    font-size: var(--text-base);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.skill-list li::before {
    content: '•';
    color: var(--primary);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
}

.experience-box {
    background: var(--gradient-primary);
    color: var(--white);
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    margin-top: var(--space-xl);
    box-shadow: var(--shadow-primary);
}

.experience-box h4 {
    color: var(--white);
    margin-bottom: var(--space-sm);
}

.experience-box p {
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: var(--space-sm);
}

.experience-box ul {
    list-style: none;
    margin-top: var(--space-md);
}

.experience-box ul li {
    padding: var(--space-sm) 0;
    padding-left: var(--space-lg);
    position: relative;
}

.experience-box ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: rgba(255, 255, 255, 0.8);
}

.resume-cta {
    text-align: center;
    margin-top: var(--space-2xl);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: var(--space-2xl) 0 var(--space-lg);
}

.footer-section p {
    color: var(--white);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-section h3 {
    color: var(--white);
    margin-bottom: var(--space-md);
}

.footer-contact {
    list-style: none;
}

.footer-contact li {
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.footer-contact a {
    color: var(--gray-300);
}

.footer-contact a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--gray-800);
    color: var(--gray-500);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    .hero-title {
        font-size: var(--text-4xl);
    }

    .hero-subtitle {
        font-size: var(--text-xl);
    }

    .hero-description {
        font-size: var(--text-base);
    }

    .section-title {
        font-size: var(--text-3xl);
    }

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

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

    .navbar-content {
        flex-wrap: wrap;
        gap: var(--space-md);
    }

    .navbar-menu {
        display: none; /* Simple approach for quick implementation */
    }

    .language-switcher {
        margin-left: auto;
        gap: 8px;
    }

    .lang-btn {
        padding: 8px 12px;
        font-size: 11px;
        gap: 5px;
    }

    .lang-btn .fi {
        font-size: 15px;
    }

    .lang-btn:hover {
        transform: translateY(-2px);
    }

    .lang-btn.active:hover {
        transform: translateY(-1px);
    }

    .hero-cta {
        flex-direction: column;
    }

    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-md);
    }

    .section {
        padding: var(--space-2xl) 0;
    }

    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes simpleFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Simple fade in - Clean & Fast */
.fade-in {
    opacity: 0;
    animation: simpleFade 0.4s ease-out forwards;
}

/* Minimal staggered delays */
.fade-in-delay-1 { animation-delay: 0.05s; }
.fade-in-delay-2 { animation-delay: 0.1s; }
.fade-in-delay-3 { animation-delay: 0.15s; }

/* ========================================
   IMAGE GALLERY MODAL
   ======================================== */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: var(--z-modal);
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: hidden;
}

.gallery-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gallery-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#galleryImage {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2xl);
}

.gallery-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--white);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    z-index: 10;
}

.gallery-close:hover {
    background: var(--white);
    color: var(--gray-900);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--white);
    color: var(--white);
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    z-index: 10;
}

.gallery-nav:hover {
    background: var(--white);
    color: var(--gray-900);
}

.gallery-prev {
    left: 20px;
}

.gallery-next {
    right: 20px;
}

.gallery-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.gallery-title {
    color: var(--white);
    margin-top: var(--space-lg);
    text-align: center;
}

.btn-gallery {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* Responsive gallery */
@media (max-width: 768px) {
    .gallery-nav {
        width: 50px;
        height: 50px;
    }

    .gallery-close {
        width: 45px;
        height: 45px;
        top: 10px;
        right: 10px;
    }

    .gallery-prev {
        left: 10px;
    }

    .gallery-next {
        right: 10px;
    }

    #galleryImage {
        max-height: 70vh;
    }
}
