/* Google Fonts Import - Poppins for headings, Lato for body text */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Poppins:wght@400;600;700&display=swap');

/* --- Variables for Easy Theming --- */
:root {
    --primary-color: #00a86b; /* Vibrant emerald green */
    --secondary-color: #007bff; /* Bright blue - for accents */
    --accent-color: #28a745; /* Forest green - for highlights */
    --dark-bg: #0d1421; /* Dark blue-green background */
    --light-text: #e8f5e8; /* Light green-tinted white for readability */
    --card-bg: #1a2332; /* Dark blue-green for cards */
    --border-color: #2c5530; /* Green-tinted border */
    --shadow-light: rgba(0, 168, 107, 0.1);
    --shadow-dark: rgba(0, 123, 255, 0.2);
    --transition-speed: 0.3s ease;
}

/* --- Base Styles & Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
    line-height: 1.7;
    color: var(--light-text);
    background-color: var(--dark-bg);
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* --- Global Utilities --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 25px;
}

.section-padding {
    padding: 100px 0;
    position: relative; /* For potential background elements */
}

h1, h2, h3, h4 {
    font-family: 'Poppins', sans-serif;
    color: var(--light-text);
    margin-bottom: 25px;
    font-weight: 700;
}

h1 { font-size: 3.8em; line-height: 1.1; }
h2 { font-size: 2.8em; text-align: center; margin-bottom: 60px; position: relative; }
h2::after { /* Underline effect for section titles */
    content: '';
    position: absolute;
    left: 50%;
    bottom: -15px;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}
h3 { font-size: 2em; }

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed), transform var(--transition-speed);
}

a:hover {
    color: var(--secondary-color);
    transform: translateY(-2px);
}

ul {
    list-style: none;
}

p {
    margin-bottom: 15px;
}

/* --- Header/Hero Section --- */
#hero {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #004d40 50%, #1565c0 100%);
    color: var(--light-text);
    text-align: center;
    padding: 150px 0 120px;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Particle animation background */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.particles::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="%2300a86b" opacity="0.2"><animate attributeName="opacity" values="0.1;0.8;0.1" dur="3s" repeatCount="indefinite"/></circle><circle cx="80" cy="40" r="1.5" fill="%23007bff" opacity="0.2"><animate attributeName="opacity" values="0.1;0.6;0.1" dur="4s" repeatCount="indefinite"/></circle><circle cx="40" cy="80" r="1" fill="%2328a745" opacity="0.2"><animate attributeName="opacity" values="0.1;0.9;0.1" dur="2s" repeatCount="indefinite"/></circle></svg>') repeat;
    animation: particleMove 20s linear infinite;
}

@keyframes particleMove {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-100px); }
}

.hero-content {
    position: relative;
    z-index: 2;
}

#hero h1 {
    font-size: 4.5em;
    margin-bottom: 15px;
    animation: fadeInDown 1s forwards;
    letter-spacing: 3px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#hero h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: var(--light-text);
    opacity: 0;
    animation: fadeInUp 1s 0.5s forwards;
}

#hero h2::after { display: none; } /* Remove underline for hero h2 */

.hero-description {
    font-size: 1.2em;
    margin-bottom: 40px;
    max-width: 600px;
    opacity: 0;
    animation: fadeIn 1s 1s forwards;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeIn 1s 1.2s forwards;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-speed);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-secondary {
    background: transparent;
    color: var(--light-text);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--shadow-dark);
}

.btn-primary:hover {
    background: linear-gradient(45deg, var(--secondary-color), var(--accent-color));
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.social-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 1s 1.4s forwards;
}

.social-links a {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--light-text);
    font-size: 1.5em;
    transition: all var(--transition-speed);
    backdrop-filter: blur(10px);
}

.social-links a:hover {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    transform: translateY(-5px) scale(1.1);
    color: white;
}

/* --- Navigation Bar --- */
#navbar {
    background: rgba(13, 20, 33, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-speed);
}

#navbar .container {
    padding: 0 25px;
}

#navbar ul {
    display: flex;
    justify-content: center;
    padding: 20px 0;
    margin: 0;
    gap: 40px;
}

#navbar ul li a {
    color: var(--light-text);
    font-weight: 600;
    padding: 10px 0;
    position: relative;
    transition: color var(--transition-speed);
}

#navbar ul li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition-speed);
}

#navbar ul li a:hover::after,
#navbar ul li a.active::after {
    width: 100%;
}

#navbar ul li a:hover {
    color: var(--primary-color);
}

/* --- Section Styling --- */
section:not(#hero):nth-of-type(odd) {
    background-color: var(--dark-bg);
}

section:not(#hero):nth-of-type(even) {
    background-color: #22223a; /* Slightly lighter dark for contrast */
}

/* --- Enhanced Card Styles --- */
.card {
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px var(--shadow-dark);
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* --- About Section --- */
#about p {
    max-width: 800px;
    margin: 0 auto 20px;
    text-align: center;
    font-size: 1.1em;
    line-height: 1.8;
}

/* --- Skills Section --- */
#skills .skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.skill-category {
    padding: 25px; /* Adjust padding if using .card directly */
}

.skill-category h3 {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.3em;
    margin-bottom: 25px;
}

.skill-category h3 i {
    color: var(--secondary-color);
    font-size: 1.2em;
}

.skill-item {
    margin-bottom: 20px;
}

.skill-item span {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--light-text);
}

.skill-bar {
    background: rgba(255, 255, 255, 0.1);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    width: 0;
    transition: width 2s ease-in-out;
    position: relative;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}

/* --- Timeline for Experience --- */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
    width: 50%;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 30px;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 30px;
}

.timeline-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: 3px solid var(--dark-bg);
    border-radius: 50%;
    top: 20px;
}

.timeline-item:nth-child(odd) .timeline-marker {
    right: -10px;
}

.timeline-item:nth-child(even) .timeline-marker {
    left: -10px;
}

.timeline-content {
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 20px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -20px;
    border-left-color: var(--card-bg);
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -20px;
    border-right-color: var(--card-bg);
}

/* --- Projects Grid --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.project-card {
    overflow: hidden;
    transition: transform var(--transition-speed);
}

.project-image {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -30px -30px 20px -30px;
}

.project-placeholder {
    font-size: 3em;
    color: white;
    opacity: 0.8;
}

.project-content h3 {
    color: var(--light-text);
    margin-bottom: 15px;
}

.project-content p {
    line-height: 1.6;
    margin-bottom: 20px;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tech-tag {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.tech-tag:nth-child(even) {
    background: var(--secondary-color);
}

.project-links {
    display: flex;
    gap: 15px;
}

.project-links .btn-primary,
.project-links .btn-secondary {
    padding: 10px 20px;
    font-size: 0.9em;
}

/* --- Contact Section Enhanced --- */
.contact-intro {
    text-align: center;
    font-size: 1.2em;
    margin-bottom: 50px;
    color: var(--light-text);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.contact-info-cards {
    display: grid;
    gap: 20px;
}

.contact-card {
    text-align: center;
    padding: 25px;
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.5em;
    color: white;
}

.contact-card h3 {
    color: var(--light-text);
    font-size: 1.2em;
    margin-bottom: 10px;
}

.contact-card p {
    color: var(--light-text);
    margin-bottom: 15px;
}

.contact-form-container {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    border: 1px solid var(--border-color);
}

.contact-form h3 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--light-text);
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--dark-bg);
    color: var(--light-text);
    font-family: inherit;
    transition: border-color var(--transition-speed);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #888;
}

/* --- Back to Top Button --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    transition: all var(--transition-speed);
    z-index: 1000;
    box-shadow: 0 5px 15px var(--shadow-dark);
}

.back-to-top:hover {
    background: linear-gradient(45deg, var(--secondary-color), var(--accent-color));
    transform: translateY(-3px);
}

.back-to-top.show {
    display: flex;
}

/* --- Loading Screen --- */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader {
    text-align: center;
}

.loader-text {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5em;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.loader-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loader-bar::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    animation: loading 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* --- Enhanced Footer --- */
footer {
    background: var(--dark-bg);
    border-top: 1px solid var(--border-color);
    padding: 50px 0 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.3em;
}

.footer-section p {
    color: var(--light-text);
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: var(--light-text);
    transition: color var(--transition-speed);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-social {
    display: flex;
    gap: 15px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light-text);
    transition: all var(--transition-speed);
}

.footer-social a:hover {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--light-text);
}

/* --- Animations --- */
@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* --- Additional Interactive Elements --- */
.typewriter {
    border-right: 2px solid var(--primary-color);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { border-color: var(--primary-color); }
    51%, 100% { border-color: transparent; }
}

/* --- Hover Effects for Links --- */
a {
    transition: all var(--transition-speed);
}

/* --- Section Transitions --- */
section {
    opacity: 0;
    animation: fadeIn 0.8s ease-in-out forwards;
}

/* --- Gradient Text Effects --- */
.gradient-text {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Glowing Effects --- */
.glow {
    box-shadow: 0 0 20px rgba(0, 168, 107, 0.3);
    transition: box-shadow var(--transition-speed);
}

.glow:hover {
    box-shadow: 0 0 30px rgba(0, 123, 255, 0.5);
}

/* --- Parallax Effect for Hero --- */
#hero {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* --- Smooth Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--secondary-color), var(--accent-color));
}