/**
 * ============================================================================
 * MODERN PORTFOLIO - INSPIRED BY APP.TSX
 * ============================================================================
 * 
 * Professional design with:
 * - Two-column layout
 * - Card-based UI
 * - Teal accent color
 * - Modern shadows and borders
 * - Smooth interactions
 * 
 * @author Endryw Lucas Nobre
 * @version 4.0.0
 * ============================================================================
 */

/* ============================================================================
   CSS RESET & BASE
   ============================================================================ */

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

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

/* ============================================================================
   CSS VARIABLES - LIGHT & DARK THEMES
   ============================================================================ */

:root {
    /* Light Theme (Default) */
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f4f4f5;
    --bg-hover: #fafafa;
    
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-tertiary: #71717a;
    --text-muted: #a1a1aa;
    
    --border-primary: #e4e4e7;
    --border-secondary: #d4d4d8;
    
    --accent-primary: #0f766e;
    --accent-light: #f0fdfa;
    --accent-lighter: #ccfbf1;
    --accent-bright: #5eead4;
    --accent-dark: #134e4a;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-primary: #0a0a0a;
    --bg-secondary: #18181b;
    --bg-tertiary: #27272a;
    --bg-hover: #27272a;
    
    --text-primary: #fafafa;
    --text-secondary: #d4d4d8;
    --text-tertiary: #a1a1aa;
    --text-muted: #71717a;
    
    --border-primary: #27272a;
    --border-secondary: #3f3f46;
    
    --accent-primary: #5eead4;
    --accent-light: #134e4a;
    --accent-lighter: #0f766e;
    --accent-bright: #99f6e4;
    --accent-dark: #ccfbf1;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

::selection {
    background: var(--accent-lighter);
    color: var(--accent-dark);
}

/* ============================================================================
   NAVIGATION
   ============================================================================ */

.nav {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-primary);
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar-small {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-lighter) 100%);
    border: 1px solid var(--border-secondary);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent-primary);
    overflow: hidden;
}

.nav-name {
    font-weight: 600;
    color: var(--text-primary);
}

.theme-toggle {
    padding: 0.5rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
    box-shadow: var(--shadow-sm);
}

.icon-sun {
    color: var(--text-tertiary);
    transition: transform 0.3s ease;
}

[data-theme="dark"] .icon-sun {
    transform: rotate(180deg);
}

/* ============================================================================
   MAIN CONTAINER
   ============================================================================ */

.main-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem 6rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 1024px) {
    .main-container {
        grid-template-columns: 7fr 5fr;
        padding-top: 2rem;
    }
}

/* ============================================================================
   LEFT COLUMN
   ============================================================================ */

.left-column {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Hero Section */
.hero-section {
    margin-bottom: 1rem;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.hero-content {
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.hero-content p {
    margin-bottom: 1.5rem;
}

.highlight {
    color: var(--accent-primary);
    font-weight: 600;
    background: var(--accent-light);
    padding: 0 0.25rem;
    border-radius: 0.25rem;
}

.hero-emphasis {
    font-weight: 500;
    color: var(--text-primary);
}

/* ============================================================================
   CARDS
   ============================================================================ */

.card {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.card-icon {
    background: var(--bg-tertiary);
    padding: 0.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon svg {
    color: var(--accent-primary);
}

.card-label {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Contact Card */
.contact-card {
    max-width: 28rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.contact-link:hover {
    color: var(--accent-primary);
}

.icon-external {
    color: var(--border-secondary);
    flex-shrink: 0;
}

/* Links Card */
.links-card {
    max-width: 28rem;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    margin: 0 -0.75rem;
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--text-tertiary);
    transition: all 0.2s ease;
}

.social-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.social-link-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.social-link-content svg {
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.social-link:hover .social-link-content svg {
    color: var(--accent-primary);
}

.social-link-content span {
    font-weight: 500;
}

.icon-chevron {
    color: var(--border-primary);
    transition: color 0.2s ease;
}

.social-link:hover .icon-chevron {
    color: var(--accent-bright);
}

/* ============================================================================
   RIGHT COLUMN
   ============================================================================ */

.right-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .right-column {
        padding-top: 1rem;
    }
}

/* Profile Photo */
.profile-photo {
    aspect-ratio: 4/3;
    border-radius: 1.5rem;
    background: var(--bg-tertiary);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    position: relative;
    cursor: pointer;
}

.profile-image,
.profile-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.5s ease, filter 0.5s ease, transform 0.5s ease;
}

.profile-image {
    filter: grayscale(20%);
    transform: scale(1.05);
    opacity: 1;
    z-index: 2;
}

.profile-video {
    filter: grayscale(0%);
    transform: scale(1);
    opacity: 0;
    z-index: 1;
}

/* Desktop only: Show video on hover */
@media (min-width: 1024px) and (hover: hover) {
    .profile-photo:hover .profile-image {
        opacity: 0;
        filter: grayscale(0%);
        transform: scale(1);
    }

    .profile-photo:hover .profile-video {
        opacity: 1;
    }
}

/* Mobile: Only show image with hover effect */
@media (max-width: 1023px), (hover: none) {
    .profile-video {
        display: none;
    }

    .profile-photo:active .profile-image {
        filter: grayscale(0%);
        transform: scale(1);
    }
}


/* Work Card */
.work-card {
    border-radius: 1.5rem;
}

.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-title svg {
    color: var(--accent-primary);
}

.download-cv {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 9999px;
    border: 1px solid var(--border-primary);
    transition: all 0.2s ease;
}

.download-cv:hover {
    background: var(--accent-light);
    color: var(--accent-primary);
    border-color: var(--accent-bright);
}

/* Experience List */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.experience-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: all 0.2s ease;
}

.experience-item:hover .experience-company {
    color: var(--accent-primary);
}

.experience-logo {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-primary);
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.experience-item:hover .experience-logo {
    border-color: var(--accent-lighter);
    box-shadow: var(--shadow-md);
}

.experience-logo img {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
    filter: grayscale(100%);
    transition: filter 0.2s ease;
}

.experience-item:hover .experience-logo img {
    filter: grayscale(0%);
}

.experience-content {
    flex: 1;
    padding-top: 0.25rem;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.experience-company {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.experience-period {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.experience-role {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Projects Card */
.projects-card {
    border-radius: 1.5rem;
}

.project-item {
    display: block;
    padding: 1rem;
    margin: 0 -1rem;
    border-radius: 1rem;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.project-item:hover {
    background: var(--bg-hover);
}

.project-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.project-item:hover .project-title {
    color: var(--accent-primary);
}

.icon-chevron-right {
    color: var(--accent-bright);
    opacity: 0;
    transform: translateX(-0.5rem);
    transition: all 0.2s ease;
}

.project-item:hover .icon-chevron-right {
    opacity: 1;
    transform: translateX(0);
}

.project-description {
    font-size: 0.875rem;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.project-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.project-item:hover .project-link {
    color: var(--accent-primary);
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--border-primary);
    text-align: center;
}

.footer p {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 1023px) {
    .nav-container {
        padding: 1.5rem 1.25rem;
    }

    .main-container {
        padding: 1.5rem 1.25rem 4rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-content {
        font-size: 1rem;
    }

    .experience-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .contact-card,
    .links-card {
        max-width: 100%;
    }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

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

.card,
.hero-section,
.profile-photo {
    animation: fadeIn 0.6s ease-out backwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Visible */
:focus-visible {
    outline: 2px solid #0f766e;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    body {
        background: white;
    }

    .nav,
    .theme-toggle,
    .footer {
        display: none;
    }

    .main-container {
        display: block;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e4e4e7;
    }
}
