/* --- General Setup & Variables --- */
:root {
    --primary-color: #10b981; /* Emerald Green */
    --primary-darker: #059669;
    --secondary-color: #3b82f6; /* Blue */
    
    --bg-light: #f9fafb;
    --text-light: #1f2937;
    --card-bg-light: #ffffff;
    --border-light: #e5e7eb;

    --bg-dark: #111827;
    --text-dark: #f3f4f6;
    --card-bg-dark: #1f2937;
    --border-dark: #374151;
    
    --font-family: 'Inter', sans-serif;
}

[data-theme="dark"] {
    --background: var(--bg-dark);
    --text-color: var(--text-dark);
    --card-bg: var(--card-bg-dark);
    --border-color: var(--border-dark);
    --header-bg: rgba(17, 24, 39, 0.9);
}

[data-theme="light"] {
    --background: var(--bg-light);
    --text-color: var(--text-light);
    --card-bg: var(--card-bg-light);
    --border-color: var(--border-light);
    --header-bg: rgba(255, 255, 255, 0.9);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--background);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 7rem 0;
}

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
}

.section-title {
    font-size: 2.8rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 1rem auto 0;
}

/* --- Buttons --- */
.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    transform: translateY(-2px);
    background-color: var(--primary-darker);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.cta-button.secondary {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.cta-button.secondary:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* --- Header & Navigation --- */
#header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

#header.scrolled {
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 10px rgba(0,0,0,0.1);
}

#header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    position: relative;
    transition: color 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
}

.nav-right { display: flex; align-items: center; gap: 1rem; }
.hamburger { display: none; cursor: pointer; }
.bar { display: block; width: 25px; height: 3px; margin: 5px auto; background-color: var(--text-color); transition: 0.3s; }
#theme-toggle { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-color); }

/* --- Home Section --- */
#home {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px; /* Height of header */
}

.home-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
}

.home-text { flex: 1; }
.home-image {
    width: 300px;
    height: 300px;
    overflow: hidden;
    border-radius: 10px;
    transition: transform 0.3s ease;
}
.home-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.home-image:hover img {
  transform: scale(1.1);
}
.subtitle {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.intro-text {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1rem;
}
.typing-text {
    color: var(--primary-color);
    border-right: 3px solid var(--primary-color);
    animation: blink-caret 0.75s step-end infinite;
}
@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary-color); }
}
.typing-text.stop-blinking {
    animation: none;
}
.home-text p {
    margin-bottom: 2rem;
    max-width: 500px;
}
.home-buttons {
    display: flex;
    gap: 1rem;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: var(--text-color);
    animation: bounce 2s infinite;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* --- About Section --- */
#about { background-color: var(--card-bg); }
.about-content { display: flex; gap: 4rem; }
.bio, .skills { flex: 1; }
.bio h3, .skills h3 { font-size: 2rem; margin-bottom: 1.5rem; }
.bio p { margin-bottom: 1rem; }
.download-cv { margin-top: 1.5rem; }

/* Skill Bars */
.skill-item { margin-bottom: 1.5rem; }
.skill-info { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-weight: 600; }
.skill-bar { width: 100%; height: 8px; background-color: var(--border-color); border-radius: 5px; overflow: hidden; }
.skill-level { height: 100%; width: var(--level); background-color: var(--primary-color); border-radius: 5px; transition: width 1.5s ease-out; }

/* --- Services Section --- */
#services { background-color: var(--card-bg); }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.service-card { background-color: transparent; height: 350px; perspective: 1000px; }
.service-card-inner { position: relative; width: 100%; height: 100%; text-align: center; transition: transform 0.8s; transform-style: preserve-3d; box-shadow: 0 4px 15px rgba(0,0,0,0.1); border-radius: 10px; }
.service-card:hover .service-card-inner { transform: rotateY(180deg); }
.service-card-front, .service-card-back { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2rem; }
.service-card-front { background: var(--background); color: var(--text-color); }
.service-card-front i { font-size: 3.5rem; color: var(--primary-color); margin-bottom: 1.5rem; }
.service-card-front h3 { font-size: 1.5rem; font-weight: 700; }
.service-card-back { background: var(--primary-color); color: white; transform: rotateY(180deg); }
.service-card-back h3 { margin-bottom: 1rem; }

/* --- Projects Section --- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }

.project-card-link {
    text-decoration: none;
    color: inherit;
}

.project-card { 
    position: relative; 
    overflow: hidden; 
    border-radius: 10px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); 
    transition: transform 0.3s ease; 
}
.project-card:hover { 
    transform: translateY(-10px); 
}
.project-card img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block; 
}
.project-overlay { 
    position: absolute; 
    top: 0; left: 0; right: 0; bottom: 0; 
    background: rgba(17, 24, 39, 0.85); 
    color: #fff; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    text-align: center; 
    opacity: 0; 
    transition: opacity 0.4s ease; 
    padding: 1rem; 
}
.project-card:hover .project-overlay { 
    opacity: 1; 
}
.project-overlay h3 { 
    font-size: 1.5rem; 
    margin-bottom: 0.5rem; 
}

/* --- Timeline Section --- */
#timeline { background-color: var(--card-bg); }
.timeline-container { display: flex; gap: 3rem; justify-content: center; }
.timeline-column { flex: 1; max-width: 500px; }
.timeline-header { font-size: 1.8rem; margin-bottom: 2rem; display: flex; align-items: center; gap: 0.5rem; }
.timeline-item { position: relative; padding-left: 30px; padding-bottom: 2rem; border-left: 2px solid var(--primary-color); }
.timeline-item:last-child { border-left: 2px solid transparent; }
.timeline-dot { position: absolute; left: -9px; top: 5px; width: 16px; height: 16px; border-radius: 50%; background-color: var(--background); border: 3px solid var(--primary-color); }
.timeline-item h4 { font-size: 1.2rem; font-weight: 600; }
.date { display: block; font-size: 0.9rem; color: var(--primary-color); margin-bottom: 0.5rem; }

/* --- Contact Section --- */
.contact-wrapper { display: flex; gap: 3rem; align-items: center; }
.contact-info, .contact-form { flex: 1; }
.contact-info h3 { font-size: 2rem; margin-bottom: 1.5rem; }
.contact-info p { margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group input, .form-group textarea { width: 100%; padding: 1rem; border-radius: 8px; border: 1px solid var(--border-color); background-color: var(--card-bg); color: var(--text-color); font-family: var(--font-family); }
.social-links { margin-top: 2rem; }
.social-links a { font-size: 1.5rem; margin-right: 1.5rem; color: var(--text-color); transition: color 0.3s ease; }
.social-links a:hover { color: var(--primary-color); }
#form-status { margin-top: 1rem; font-weight: 600; }

/* --- Footer --- */
#footer { background-color: var(--bg-dark); color: #e2e8f0; padding-top: 4rem; }
.footer-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; padding-bottom: 3rem; }
.footer-column h3, .footer-column h4 { font-size: 1.2rem; margin-bottom: 1.5rem; color: #fff; font-weight: 600; }
.footer-column.about p { color: #a0aec0; margin-bottom: 1.5rem; }
.footer-social-links a { color: #a0aec0; margin-right: 1rem; font-size: 1.5rem; transition: color 0.3s ease; }
.footer-social-links a:hover { color: var(--primary-color); }
.footer-column.links ul { list-style: none; }
.footer-column.links li { margin-bottom: 0.8rem; }
.footer-column.links a { color: #a0aec0; text-decoration: none; transition: color 0.3s ease; }
.footer-column.links a:hover { color: var(--primary-color); }
.footer-column.contact p { color: #a0aec0; margin-bottom: 0.8rem; display: flex; align-items: center; gap: 0.75rem; }
.newsletter-form { display: flex; position: relative; }
.newsletter-form input { width: 100%; padding: 0.8rem; border: none; border-radius: 5px; background-color: #2d3748; color: #fff; }
.newsletter-form button { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); background: var(--primary-color); color: #fff; border: none; border-radius: 5px; padding: 0.5rem 0.8rem; cursor: pointer; transition: background-color 0.3s ease; }
.newsletter-form button:hover { background-color: var(--primary-darker); }
.footer-bottom { border-top: 1px solid var(--border-dark); text-align: center; padding: 1.5rem 0; color: #a0aec0; }

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .home-content { flex-direction: column-reverse; text-align: center; padding-top: 2rem; }
    .home-text p { margin-left: auto; margin-right: auto; }
    .home-buttons { justify-content: center; }
    .intro-text { font-size: 3rem; }
    .home-image img { max-width: 400px; }
}

@media (max-width: 768px) {
    /* Mobile Nav */
    .nav-links { position: fixed; left: -100%; top: 80px; gap: 0; flex-direction: column; background-color: var(--card-bg); width: 100%; text-align: center; transition: 0.3s; box-shadow: 0 10px 10px rgba(0,0,0,0.1); }
    .nav-links.active { left: 0; }
    .nav-links li { padding: 1rem 0; }
    .hamburger { display: block; }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* Sections */
    .about-content, .timeline-container, .contact-wrapper { flex-direction: column; }
    .timeline-column { max-width: 100%; }
    
    /* Footer */
    .footer-container { grid-template-columns: 1fr; text-align: center; }
    .footer-social-links, .footer-column.contact p { justify-content: center; }
}