/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

:root {
    --primary: #ff6600;
    --primary-dark: #e55b00;
    --light: #ffffff;
    --light-gray: #f5f5f5;
    --gray: #888888;
    --dark: #333333;
    --text-dark: #222222;
    --text-muted: #666666;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
}

html::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

body {
    background: var(--light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    color: var(--dark);
    padding-bottom: 15px;
}

h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

/* Section Padding */
section {
    padding: 80px 10%;
    position: relative;
}

section:nth-child(odd) {
    background: linear-gradient(120deg, #f8f8f8, #f0f0f0);
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: 0.4s ease;
}

.navbar.scrolled {
    padding: 10px 10%;
    background: rgba(255, 255, 255, 0.98);
}

.logo span {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links li a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    position: relative;
    padding: 5px 0;
    transition: 0.3s ease;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: 0.3s ease;
}

.nav-links li a:hover {
    color: var(--primary);
}

.nav-links li a:hover::after {
    width: 100%;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-btn div {
    width: 25px;
    height: 3px;
    background: var(--dark);
    margin: 5px;
    transition: 0.3s ease;
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 120px 10% 80px;
    min-height: 100vh;
    background: linear-gradient(120deg, #ffffff, #f5f5f5);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="none"/><circle cx="10" cy="10" r="1" fill="rgba(255,102,0,0.1)"/></svg>');
    opacity: 0.5;
}

.hero-content {
    flex: 1;
    z-index: 2;
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--dark);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.highlight {
    color: var(--primary);
    font-weight: 700;
}

.hero-content p {
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: var(--text-muted);
    margin: 20px 0 30px;
    max-width: 600px;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

.hero-image img {
    max-width: 100%;
    width: clamp(250px, 80%, 400px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(255, 102, 0, 0.2);
    transition: 0.5s ease;
    transform: rotate(-3deg);
}

.hero-image img:hover {
    transform: scale(1.05) rotate(0);
    box-shadow: 0 15px 40px rgba(255, 102, 0, 0.4);
}

/* Button Styles */
.btn {
    padding: 12px 28px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: 0.3s;
    box-shadow: 0 5px 15px rgba(255, 102, 0, 0.3);
    text-decoration: none;
    display: inline-block;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--primary-dark);
    transition: 0.5s ease;
    z-index: -1;
    border-radius: 30px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 102, 0, 0.4);
}

.btn:hover::before {
    width: 100%;
}

.btn-small {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.3s;
    text-decoration: none;
    display: inline-block;
    margin-top: 15px;
}

.btn-small:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* About Section */
#about {
    text-align: center;
}

#about p {
    max-width: 800px;
    margin: 0 auto 20px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.about-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 50px;
    margin-top: 40px;
}

.stat {
    text-align: center;
    flex: 1;
    min-width: 150px;
    max-width: 250px;
}

.stat .count {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin-bottom: 10px;
}

.stat p {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Skills Section - UPDATED */
.skills-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-top: 40px;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 20px;
    flex-wrap: nowrap;
}

/* Hide scrollbar but keep functionality */
.skills-container::-webkit-scrollbar {
    display: none;
}

/* Skills Section - UPDATED */
.skills-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    width: 100%;
    flex-wrap: wrap;
}

.skill {
    background: var(--light);
    border-radius: 15px;
    overflow: hidden;
    padding: 20px;
    text-align: center;
    transition: 0.4s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    border: 1px solid #eee;
    flex: 1;
    min-width: 160px;
    max-width: 200px;
}

/* Remove the horizontal scroll styles */
.skills-container::-webkit-scrollbar {
    display: initial;
}

.skills-container {
    -ms-overflow-style: initial;
    scrollbar-width: initial;
    overflow-x: initial;
}

/* Responsive adjustment for skills */
@media (max-width: 768px) {
    .skills-container {
        justify-content: center;
    }
    
    .skill {
        flex: 0 0 calc(33.333% - 20px);
        min-width: 140px;
    }
}

@media (max-width: 480px) {
    .skill {
        flex: 0 0 calc(50% - 20px);
    }
}

.skill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: 0.4s ease;
}

.skill:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(255, 102, 0, 0.15);
}

.skill:hover::before {
    transform: scaleX(1);
}

.skill img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
    transition: 0.4s ease;
}

.skill:hover img {
    transform: scale(1.1);
}

.skill p {
    font-weight: 600;
    color: var(--text-dark);
    margin-top: 10px;
    margin-bottom: 10px;
    text-align: center;
}

.skill-progress {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
    transition: width 1.5s ease-in-out;
}

/* Projects Section */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
    justify-content: center;
}

.flip-card {
    background-color: transparent;
    height: 300px;
    perspective: 1000px;
    margin-bottom: 20px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.flip-card-front {
    background-size: cover;
    background-position: center;
    color: white;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
}

.flip-card-front::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.flip-card-front p {
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.flip-card-back {
    background: white;
    color: var(--text-dark);
    transform: rotateY(180deg);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid #eee;
}

.flip-card-back .title {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 15px;
    font-weight: 700;
    text-align: center;
}

.flip-card-back .description {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-align: center;
}

/* Achievements Section */
.achievements-container {
    display: flex;
    overflow-x: auto;
    margin-top: 40px;
    width: 100%;
    position: relative;
    padding-bottom: 20px;
    scrollbar-width: none;
}

.achievements-container::-webkit-scrollbar {
    display: none;
}

.achievements-wrapper {
    display: flex;
    transition: transform 0.5s ease;
    width: 100%;
}

.achievement {
    background: var(--light);
    border-radius: 15px;
    overflow: hidden;
    min-width: 300px;
    margin-right: 30px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: 0.4s ease;
    border: 1px solid #eee;
    flex: 0 0 calc(33.333% - 20px);
}

.achievement:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(255, 102, 0, 0.2);
}

.achievement-img {
    overflow: hidden;
}

.achievement img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: 0.4s ease;
}

.achievement:hover img {
    transform: scale(1.05);
}

.achievement h3 {
    padding: 20px 20px 10px;
    color: var(--primary);
    font-size: 1.2rem;
    text-align: center;
}

.achievement p {
    padding: 0 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 15px;
    text-align: center;
}

.achievement-link {
    padding: 0 20px 20px;
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: 0.3s;
    position: relative;
    text-align: center;
}

.achievement-link::after {
    content: '→';
    position: absolute;
    opacity: 0;
    right: 5px;
    transition: 0.3s;
}

.achievement-link:hover {
    padding-right: 25px;
}

.achievement-link:hover::after {
    opacity: 1;
    right: 15px;
}

/* Achievements slider controls */
.achievement-controls {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 15px;
}

.control-btn {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--light-gray);
    border: 1px solid var(--gray);
    cursor: pointer;
    transition: 0.3s;
}

.control-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

/* Auto slide animation */
@keyframes slide {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Contact Section */
#contact {
    padding: 80px 10%;
    background: linear-gradient(120deg, #f8f8f8, #f0f0f0);
}

.contact-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 40px;
}

.contact-info {
    background: var(--light);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    flex: 1;
    min-width: 280px;
    max-width: 400px;
    border: 1px solid #eee;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.contact-item i {
    color: var(--primary);
    font-size: 20px;
    margin-right: 15px;
    width: 30px;
    text-align: center;
}

.contact-item p {
    color: var(--text-muted);
}

.contact-info a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.contact-info a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.social-icons a {
    display: inline-flex;
    width: 50px;
    height: 50px;
    background: #f5f5f5;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    transition: 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.social-icons a:hover {
    background: var(--primary);
    transform: translateY(-5px);
}

.social-icons i {
    color: var(--dark);
}

.social-icons a:hover i {
    color: white;
}

.contact-form {
    flex: 1;
    max-width: 600px;
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: var(--light);
    color: var(--text-dark);
    font-size: 1rem;
    transition: 0.3s;
    outline: none;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.form-group input:focus,
.form-group textarea:focus {
    box-shadow: 0 0 0 2px var(--primary);
    border-color: var(--primary);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* Footer */
footer {
    background: #f5f5f5;
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    border-top: 1px solid #eee;
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.appear {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
    z-index: 100;
    box-shadow: 0 5px 15px rgba(255, 102, 0, 0.3);
}

.scroll-top.active {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
}

/* Responsive Styles */
@media (max-width: 1024px) {
    section {
        padding: 60px 5%;
    }
    
    .hero {
        padding: 120px 5% 60px;
    }

    .achievement {
        flex: 0 0 calc(50% - 15px);
        min-width: 280px;
    }
    
    /* Allow skills to scroll horizontally on smaller screens */
    .skills-container {
        justify-content: flex-start;
        padding-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .projects-container {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 30px;
        margin-top: 40px;
        justify-content: center;
    }
    
    .flip-card {
        background-color: transparent;
        height: 300px;
        perspective: 1000px;
        margin-bottom: 20px;
        overflow: hidden; /* Prevent overflow */
    }
    
    .flip-card-inner {
        position: relative;
        width: 100%;
        height: 100%;
        text-align: center;
        transition: transform 0.6s;
        transform-style: preserve-3d;
    }
    
    .flip-card-back {
        background: white;
        color: var(--text-dark);
        transform: rotateY(180deg);
        padding: 20px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        border: 1px solid #eee;
        box-sizing: border-box;
        height: 100%;
        overflow: hidden; /* Prevent content overflow */
    }
    
    .flip-card-back .title {
        font-size: 1.5rem;
        color: var(--primary);
        margin-bottom: 10px;
        font-weight: 700;
        text-align: center;
        flex-shrink: 0;
    }
    
    .flip-card-back .description {
        font-size: 0.95rem;
        color: var(--text-muted);
        text-align: center;
        flex-grow: 1;
        display: flex;
        align-items: center;
        margin-bottom: 15px;
        overflow: hidden;
        line-height: 1.4;
    }
    
    .flip-card-back .btn-small {
        flex-shrink: 0;
        margin-top: auto;
        padding: 8px 16px;
        font-size: 0.9rem;
        max-width: 80%; /* Prevent button from being too wide */
    }
    
    /* Mobile responsive - 2x n grid for small devices */
    @media (max-width: 768px) {
        .projects-container {
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
            margin-top: 30px;
            padding: 0 8px;
        }
        
        .flip-card {
            height: 200px; /* Much shorter height for mobile 2x grid */
            margin-bottom: 10px;
        }
        
        .flip-card-back {
            padding: 12px; /* Minimal padding */
            justify-content: space-between;
        }
        
        .flip-card-back .title {
            font-size: 0.9rem; /* Much smaller title */
            margin-bottom: 6px;
            line-height: 1.2;
        }
        
        .flip-card-back .description {
            font-size: 0.7rem; /* Very small description */
            line-height: 1.2;
            margin-bottom: 8px;
            text-align: center;
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
        }
        
        .flip-card-back .btn-small {
            padding: 4px 8px; /* Very small button */
            font-size: 0.65rem;
            margin-top: 5px;
            max-width: 90%;
            border-radius: 3px;
        }
        
        .flip-card-front p {
            font-size: 1rem; /* Smaller front card title */
        }
    }
    
    /* Stack hero content vertically on smaller screens */
    .hero {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }
    
    .hero-content p {
        margin: 20px auto 30px;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.98);
        transition: 0.5s ease;
        z-index: 999;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .mobile-menu-btn.active div:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .mobile-menu-btn.active div:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-btn.active div:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    .achievement {
        flex: 0 0 calc(100% - 30px);
        min-width: 250px;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 10px 20px;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .contact-info, .contact-form {
        padding: 20px;
    }
    
    .form-group input, 
    .form-group textarea {
        padding: 12px;
    }
    
    .social-icons a {
        width: 40px;
        height: 40px;
    }
}
