/* ===== Variables & Theme Setup ===== */
:root {
    --bg-color: #050814;
    --text-color: #e2e8f0;
    --primary-color: #3b82f6; /* Electric Blue */
    --secondary-color: #10b981; /* Emerald Green */
    --accent-color: #8b5cf6; /* Purple */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition-standard: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Resets & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Animated Background Blob */
#blob {
    background-color: transparent;
    height: 400px;
    width: 400px;
    position: fixed;
    border-radius: 50%;
    z-index: -2;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    animation: rotate 20s infinite;
    opacity: 0.5;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#blob-blur {
    height: 100vh;
    width: 100vw;
    position: fixed;
    z-index: -1;
    backdrop-filter: blur(150px);
    pointer-events: none;
}

@keyframes rotate {
    from { rotate: 0deg; }
    50% { scale: 1 1.5; }
    to { rotate: 360deg; }
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1.2;
}

.highlight {
    color: var(--primary-color);
    font-weight: 700;
}

.glow {
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 3rem;
    font-weight: 800;
}

.underline {
    height: 4px;
    width: 80px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 10px auto 0;
    border-radius: 2px;
}

/* ===== Reusable Components ===== */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: var(--transition-standard);
}

.glass-panel:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.15);
}

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-standard);
    cursor: pointer;
    font-size: 1rem;
    font-family: var(--font-body);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.w-100 { width: 100%; justify-content: center; }
.mt-4 { margin-top: 1.5rem; }

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transition: var(--transition-standard);
}

.navbar.scrolled {
    background: rgba(5, 8, 20, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 5%;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: var(--font-heading);
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a:not(.btn-primary) {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-standard);
    opacity: 0.8;
}

.nav-links a:not(.btn-primary):hover {
    opacity: 1;
    color: var(--primary-color);
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== Main Layout & Sections ===== */
section {
    padding: 8rem 5% 4rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Scroll Animation Classes */
.hidden {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(5px);
    transition: all 1s cubic-bezier(0.5, 0, 0, 1);
}

.show {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* --- Hero Section --- */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding-top: 12rem;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.2rem;
    color: #94a3b8;
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
}

.hero-icon {
    font-size: 15rem;
    color: var(--glass-border);
    background: -webkit-linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
}

/* --- About Section --- */
.about-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.about-text p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #cbd5e1;
}

.about-stats {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    grid-column: 1 / -1;
    margin-top: 1rem;
}

.stat h3 {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat p {
    color: #94a3b8;
    font-weight: 600;
    font-size: 1.1rem;
}

/* --- Skills Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-card {
    text-align: center;
    position: relative;
    overflow: hidden;
}

.skill-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.skill-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    transform-origin: left;
    transition: transform 1.5s ease-out;
}

/* --- Services Section --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.service-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.service-card p {
    color: #94a3b8;
}

/* --- Projects Section --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-image {
    height: 250px;
    width: 100%;
    transition: var(--transition-standard);
}

.project-card:hover .project-image {
    transform: scale(1.05);
}

.project-info {
    padding: 2rem;
    background: rgba(0,0,0,0.4);
    flex-grow: 1;
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.project-info p {
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

.view-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Contact Section --- */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    align-items: start;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
}

.social-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    text-decoration: none;
    transition: var(--transition-standard);
    font-size: 1.2rem;
}

.social-btn:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-family: var(--font-body);
    transition: var(--transition-standard);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

footer {
    text-align: center;
    padding: 3rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
    color: #64748b;
}

/* --- Image & Hover Effects --- */
.center-image {
    padding: 0;
    overflow: hidden;
    position: relative;
}

.profile-frame {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.6s ease;
    filter: brightness(0.9) contrast(1.1);
}

.hero-image:hover .profile-img {
    transform: scale(1.08);
    filter: brightness(1.1) contrast(1.2) drop-shadow(0 0 10px rgba(59,130,246,0.3));
}

.about-grid.with-image {
    grid-template-columns: 1fr 2fr;
}

.about-image {
    height: 100%;
    min-height: 300px;
}

.about-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.about-image:hover .about-img {
    transform: scale(1.05);
}

@media (max-width: 1200px) {
    .about-grid.with-image {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- Tech Carousel --- */
.tech-carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 2rem 0;
}

.tech-carousel-container::before,
.tech-carousel-container::after {
    content: '';
    position: absolute;
    top: 0;
    width: 60px;
    height: 100%;
    z-index: 2;
}

.tech-carousel-container::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-color) 0%, transparent 100%);
}

.tech-carousel-container::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-color) 0%, transparent 100%);
}

.tech-track {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    animation: scroll 40s linear infinite;
}

.tech-track:hover {
    animation-play-state: paused;
}

.tech-item {
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1.1rem;
    white-space: nowrap;
    border-radius: 50px;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 0.75rem)); }
}

/* --- Certifications 3D Flip Cards --- */
.cert-carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 2rem 0;
}

.cert-carousel-container::before,
.cert-carousel-container::after {
    content: '';
    position: absolute;
    top: 0;
    width: 60px;
    height: 100%;
    z-index: 2;
}

.cert-carousel-container::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-color) 0%, transparent 100%);
}

.cert-carousel-container::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-color) 0%, transparent 100%);
}

.cert-track {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    animation: certScroll 35s linear infinite;
}

.cert-track:hover {
    animation-play-state: paused;
}

@keyframes certScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 0.75rem)); }
}

.gallery-item {
    position: relative;
    width: 260px;
    height: 360px;
    border-radius: 12px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: rgba(255, 255, 255, 0.02);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem 1.5rem 1.5rem;
    background: linear-gradient(to top, rgba(5,8,20,0.95), transparent);
}

.gallery-overlay h3 {
    color: var(--text-color);
    font-size: 1.25rem;
    margin-bottom: 0.3rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.gallery-overlay p {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
}

/* ===== Responsive Styles ===== */
@media (max-width: 968px) {
    .hero, .about-grid, .contact-container {
        grid-template-columns: 1fr;
    }
    .hero {
        padding-top: 8rem;
        text-align: center;
    }
    .hero-title {
        font-size: 3.5rem;
    }
    .hero-buttons {
        justify-content: center;
    }
    .hero-icon {
        height: 300px;
        font-size: 10rem;
    }
    .nav-links {
        display: none; /* Add mobile menu logic in JS if needed */
    }
    .hamburger {
        display: block;
    }
    section { padding: 6rem 5% 3rem; }
}

@media (max-width: 576px) {
    .hero-title { font-size: 2.5rem; }
    .section-header h2 { font-size: 2.2rem; }
    .hero-buttons { flex-direction: column; }
    .projects-grid { grid-template-columns: 1fr; }
}

/* --- Popup Modal --- */
.popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 8, 20, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-standard);
}

.popup-modal.active {
    opacity: 1;
    visibility: visible;
}

.popup-modal .popup-content {
    background: rgba(10, 15, 30, 0.95);
    border: 1px solid var(--glass-border);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(0.8);
    transition: var(--transition-standard);
}

.popup-modal.active .popup-content {
    transform: scale(1);
}

.popup-icon {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

/* --- WhatsApp Float Button --- */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.2rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    text-decoration: none;
    transition: var(--transition-standard);
    animation: pulse-wa 2s infinite;
}

.whatsapp-float:hover {
    transform: translateY(-5px);
    background-color: #1ebe57;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
    color: white;
}

@keyframes pulse-wa {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

@media (max-width: 576px) {
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
    }
}
