/* --- CSS RESET & GLOBAL STYLES --- */
:root {
    --primary-color: #673ab7;
    --secondary-color: #ff9800;
    --dark-color: #1a1a2e;
    --light-color: #f4f4f9;
    --text-color: #333;
    --text-light: #6c757d;
    --card-bg: #ffffff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-color);
    color: var(--text-color);
    line-height: 1.7;
}

/* --- PRELOADER --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- UTILITY CLASSES --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 6rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--dark-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--primary-color);
    color: #fff;
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-3px);
}

/* --- HEADER & NAVIGATION --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.nav-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.8rem;
    color: var(--primary-color);
}

/* --- HOME SECTION --- */
#home {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: url('https://files.cdn-files-a.com/uploads/10047654/2000_67658c2cc69b2.jpg') no-repeat center center/cover;
    color: #fff;
    position: relative;
}

#home::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(26, 26, 46, 0.6), rgba(26, 26, 46, 0.9));
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-content h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-content p {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 300;
    margin-bottom: 2rem;
}

.typing-effect {
    color: var(--secondary-color);
    font-weight: 600;
    border-right: 2px solid var(--secondary-color);
    animation: blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--secondary-color); }
}

/* --- ABOUT SECTION --- */
.about-container {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.about-image {
    flex: 1;
    max-width: 380px;
}

.about-image img {
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.about-content {
    flex: 1.5;
}

.about-content h3 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.about-content p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.about-info {
    margin-top: 2rem;
}

.about-info p {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.about-info i {
    color: var(--primary-color);
    font-size: 1.2rem;
    width: 25px;
    text-align: center;
}

/* --- PROJECTS & SKILLS SECTION (CARD LAYOUT) --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.12);
}

.card-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.card-icon {
    font-size: 3rem;
    color: var(--primary-color);
    padding-top: 2rem;
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.card-content p {
    color: var(--text-light);
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

/* --- TECHNOLOGIES SECTION --- */
#technologies {
    background: var(--card-bg);
}

.tech-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
}

.tech-item {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
    display: grid;
    place-items: center;
}

.tech-item:hover {
    transform: scale(1.1) rotate(3deg);
}

.tech-item img {
    height: 60px;
    max-width: 150px;
    object-fit: contain;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.tech-item:hover img {
    filter: grayscale(0%);
}

/* --- CONTACT SECTION --- */
.contact-wrapper {
    display: flex;
    gap: 3rem;
    background: var(--card-bg);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.contact-form-container, .map-container {
    flex: 1;
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    background: var(--light-color);
    transition: all 0.3s ease;
}

.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(103, 58, 183, 0.3);
}

.contact-form textarea {
    resize: vertical;
}

.contact-form button {
    width: 100%;
    font-size: 1.1rem;
}

.map-container {
    border-radius: var(--border-radius);
    overflow: hidden;
    min-height: 400px;
}

/* --- FOOTER --- */
.footer {
    background: var(--dark-color);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 2rem 0;
}

/* --- SCROLL-UP BUTTON --- */
.scroll-up {
    position: fixed;
    right: 2rem;
    bottom: -20%;
    background: var(--primary-color);
    color: #fff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    z-index: 100;
    transition: bottom 0.4s, transform 0.4s, background-color 0.3s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.scroll-up:hover {
    background-color: var(--secondary-color);
    transform: translateY(-4px);
}

.scroll-up.show-scroll {
    bottom: 3rem;
}

/* --- ON-SCROLL REVEAL ANIMATION --- */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Add delays for staggered effect */
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }


/* --- RESPONSIVE DESIGN --- */
@media (max-width: 992px) {
    .about-container {
        flex-direction: column;
        text-align: center;
    }
    .contact-wrapper {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 80px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--light-color);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: right 0.4s ease-in-out;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 3rem;
        text-align: center;
    }

    .nav-link {
        font-size: 1.5rem;
    }

    .nav-menu.active {
        right: 0;
    }

    .hamburger {
        display: block;
    }
    
    .hamburger i.fa-times {
        display: none;
    }
    
    .nav-menu.active + .hamburger i.fa-bars {
        display: none;
    }
    
    .nav-menu.active + .hamburger i.fa-times {
        display: block;
    }

    section {
        padding: 4rem 0;
    }

    .section-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    .scroll-up {
        right: 1rem;
    }
    .contact-wrapper {
        padding: 1.5rem;
    }
}