/* ==========================================================================
   Modern Dark & Glassmorphism Design System - Nuno Facha Portfolio Makeover
   ========================================================================== */

/* Variables & Theme configuration */
:root {
    --bg-base: #0b0f19;
    --bg-surface: rgba(17, 24, 39, 0.7);
    --bg-surface-solid: #111827;
    --bg-card: rgba(31, 41, 55, 0.4);
    --bg-card-hover: rgba(31, 41, 55, 0.6);
    
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-hover: rgba(6, 182, 212, 0.3);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-cyan: #06b6d4;
    --accent-blue: #3b82f6;
    --accent-emerald: #10b981;
    --accent-purple: #8b5cf6;
    
    --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);
    --accent-gradient-hover: linear-gradient(135deg, #22d3ee 0%, #60a5fa 50%, #a78bfa 100%);
    
    --glow-cyan: 0 0 20px rgba(6, 182, 212, 0.3);
    --glow-emerald: 0 0 20px rgba(16, 185, 129, 0.3);
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
    
    --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Reset & Base Elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-base);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
}

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

ul {
    list-style: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
}

/* Utility Classes */
.text-accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}

.text-mono {
    font-family: 'Roboto Mono', monospace;
}

.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mb-40 { margin-bottom: 40px; }

/* Main Layout Wrapper */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Navigation */
.sidebar {
    width: 290px;
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 24px;
    transition: var(--transition-smooth);
}

/* Sidebar Header / Profile Photo */
.sidebar-header {
    text-align: center;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: var(--transition-bounce);
}

.profile-img:hover {
    transform: scale(1.05) rotate(3deg);
    border-color: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
}

.sidebar-header h2 {
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

/* Sidebar Navigation Links */
.nav-links {
    margin: 30px 0;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    -ms-overflow-style: none;  /* Hide scrollbar for IE/Edge */
}

.nav-links::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome, Safari, Opera */
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: var(--transition-smooth);
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
    background: var(--bg-card);
    border-color: var(--border-color);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    border-left: 3px solid var(--accent-cyan);
    border-radius: 4px 10px 10px 4px;
}

/* Sidebar Footer & Socials */
.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.social-links a {
    font-size: 1.3rem;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.social-links a:hover {
    color: var(--accent-cyan);
    transform: translateY(-3px);
    text-shadow: var(--glow-cyan);
}

.copy {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Mobile Toggle Switch */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

.mobile-toggle:hover {
    background: var(--bg-surface-solid);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* Main Content Area */
.main-content {
    margin-left: 290px;
    flex-grow: 1;
    width: calc(100% - 290px);
}

/* Section Common Layout */
section {
    padding: 100px 80px;
    border-bottom: 1px solid var(--border-color);
    min-height: auto;
}

.section-header {
    margin-bottom: 60px;
    position: relative;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
}

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

/* Hero Section Style */
#home {
    height: 100vh;
    padding: 0;
    display: flex;
    align-items: center;
    position: relative;
    background: linear-gradient(rgba(11, 15, 25, 0.85), rgba(11, 15, 25, 0.95)), 
                url('../img/background/home-bg-min.jpg') center center no-repeat;
    background-size: cover;
    background-attachment: fixed;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    padding: 0 80px;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: 15px;
    line-height: 1.1;
}

.hero-title span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.typing-text {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.4rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    min-height: 40px;
}

.typing-text span {
    color: var(--accent-cyan);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
    margin-left: 8px;
}

.cursor {
    display: inline-block;
    width: 2.5px;
    height: 1.5rem;
    background-color: var(--accent-cyan);
    margin-left: 6px;
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* About Section Styles */
.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 60px;
    align-items: start;
}

.resume-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.about-text h3 {
    font-size: 1.6rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.about-text p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 20px;
}

.about-info {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--card-shadow);
}

.about-info h3 {
    font-size: 1.3rem;
    margin-bottom: 24px;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-list li {
    display: flex;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.info-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-list .label {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.info-list .value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

/* Resume Section - Timelines */
.resume-column h3 {
    font-size: 1.5rem;
    margin-bottom: 30px;
    position: relative;
    padding-left: 15px;
    border-left: 3px solid var(--accent-cyan);
}

.timeline {
    position: relative;
    padding-left: 20px;
    border-left: 2px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.timeline-item {
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-base);
    border: 3px solid var(--accent-cyan);
    box-shadow: var(--glow-cyan);
    z-index: 2;
    transition: var(--transition-bounce);
}

.timeline-item:hover::before {
    background: var(--accent-cyan);
    transform: scale(1.3);
}

.timeline-date {
    display: inline-block;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.timeline-content {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
}

.timeline-content:hover {
    transform: translateY(-4px);
    border-color: var(--border-color-hover);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.timeline-content h4 {
    font-size: 1.15rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.timeline-content h5 {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.timeline-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.timeline-content p:last-child {
    margin-bottom: 0;
}

/* Certificate Link Icon style */
.cert-link {
    color: var(--accent-cyan);
    font-size: 0.85rem;
    margin-left: 6px;
    transition: var(--transition-smooth);
}

.cert-link:hover {
    color: var(--text-primary);
    text-shadow: var(--glow-cyan);
}

/* Events Section Styles */
.event-title {
    font-size: 1.25rem;
    margin-top: 10px;
    position: relative;
    padding-left: 14px;
    border-left: 3px solid var(--accent-purple);
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.event-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    aspect-ratio: 16/10;
    background: #000;
}

.event-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.event-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(11, 15, 25, 0.95) 0%, rgba(11, 15, 25, 0.6) 70%, transparent 100%);
    backdrop-filter: blur(2px);
    transform: translateY(10px);
    opacity: 0.9;
    transition: var(--transition-smooth);
}

.event-card:hover img {
    transform: scale(1.08);
}

.event-card:hover .event-overlay {
    transform: translateY(0);
    opacity: 1;
}

.event-overlay h4 {
    font-size: 1.05rem;
    margin-bottom: 2px;
}

.event-overlay p {
    font-size: 0.8rem;
    color: var(--accent-cyan);
}

/* Scrolling Entrance Animation classes (Triggers via JS) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    section {
        padding: 80px 40px;
    }
    .hero-content {
        padding: 0 40px;
    }
    .about-grid {
        gap: 40px;
    }
}

@media (max-width: 992px) {
    /* Mobile Toggle Button Visible */
    .mobile-toggle {
        display: flex;
    }
    
    /* Move sidebar off screen */
    .sidebar {
        left: -300px;
        box-shadow: none;
        width: 290px;
    }
    
    .sidebar.open {
        left: 0;
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.8);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    #home {
        height: 100vh;
        background-attachment: scroll; /* fixes lag on iOS */
    }
    
    .hero-content {
        padding: 0 30px;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    
    .resume-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
}

@media (max-width: 576px) {
    section {
        padding: 60px 20px;
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .hero-content {
        padding: 0 20px;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .typing-text {
        font-size: 1.1rem;
    }
    
    .about-info {
        padding: 20px;
    }
    
    .timeline-content {
        padding: 16px;
    }
}
