:root {
    --primary-color: #9b59b6;
    --primary-dark: #7d3cb5;
    --primary-light: #b07cc6;
    --background-dark: #1a1a1a;
    --background-light: #2a2a2a;
    --text-light: #ffffff;
    --text-gray: #cccccc;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--background-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Page Sections - FIXED CENTERING */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.5s ease;
    overflow-y: auto;
    text-align: center;
}

.page.active {
    display: flex;
    opacity: 1;
}

/* Navigation Buttons - FIXED MARGINS */
.nav-buttons {
    position: fixed;
    bottom: 20px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 100;
    padding: 0 5px;
}

.nav-btn {
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: 50px;
    padding: 10px 16px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    flex: 1;
    justify-content: center;
    max-width: 120px;
}

.nav-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.4);
}

.nav-btn i {
    font-size: 0.85rem;
}

/* Home Page - FIXED CENTERING */
.home-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 800px;
    width: 100%;
    padding: 0 15px;
}

.profile-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    margin-bottom: 25px;
    box-shadow: 0 0 30px rgba(155, 89, 182, 0.5);
}

.home-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
    text-align: center;
    width: 100%;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* FIXED: Typing container centering */
.typing-container {
    margin-bottom: 15px;
    height: 35px;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.typing {
    font-size: 1.6rem;
    color: var(--primary-color);
    font-weight: 600;
    text-align: center;
}

.home-description {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 25px;
    max-width: 600px;
    text-align: center;
    width: 100%;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    justify-content: center;
    width: 100%;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: var(--background-light);
    border-radius: 50%;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    font-size: 1.2rem;
}

.social-icon:hover {
    background: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(155, 89, 182, 0.3);
}

/* About Page - FIXED CENTERING */
.about-content {
    max-width: 800px;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 15px;
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 25px;
    color: var(--text-light);
    position: relative;
    text-align: center;
    width: 100%;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    border-radius: 2px;
}

.about-text {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 25px;
    line-height: 1.7;
    text-align: center;
    width: 100%;
    max-width: 600px;
}

.about-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    width: 100%;
    max-width: 600px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--background-light);
    border-radius: var(--border-radius);
    transition: var(--transition);
    text-align: left;
}

.detail-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.detail-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.detail-item h4 {
    color: var(--text-light);
    margin-bottom: 5px;
    font-size: 1rem;
}

.detail-item p {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* FIXED: Download CV button centering */
.cv-download {
    margin-top: 15px;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Skills Page - Compact Layout */
.skills-content {
    max-width: 1000px;
    text-align: center;
    width: 100%;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 20px;
    width: 100%;
}

.skill-card {
    background: var(--background-light);
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
    border: 1px solid transparent;
}

.skill-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.skill-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.skill-card h3 {
    color: var(--text-light);
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.skill-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: var(--background-dark);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

/* Rainbow Progress Bar Colors */
.progress-fill.html-css {
    background: linear-gradient(90deg, #ff6b6b, #ffa726, #ffee58, #66bb6a, #42a5f5, #5c6bc0, #ab47bc);
}

.progress-fill.js {
    background: linear-gradient(90deg, #ffee58, #66bb6a, #42a5f5);
}

.progress-fill.ui-ux {
    background: linear-gradient(90deg, #ab47bc, #ec407a, #ff7043);
}

.progress-fill.teamwork {
    background: linear-gradient(90deg, #66bb6a, #42a5f5, #5c6bc0);
}

.progress-fill.adaptability {
    background: linear-gradient(90deg, #ffa726, #ffee58, #66bb6a);
}

.progress-fill.communication {
    background: linear-gradient(90deg, #42a5f5, #5c6bc0, #ab47bc);
}

.progress-fill {
    height: 100%;
    border-radius: 5px;
    width: 0;
    transition: width 1.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.1) 0%, 
        rgba(255,255,255,0.3) 50%, 
        rgba(255,255,255,0.1) 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.skill-percent {
    color: var(--primary-color);
    font-weight: 600;
    min-width: 35px;
    font-size: 0.9rem;
}

.skill-card p {
    color: var(--text-gray);
    font-size: 0.85rem;
}

/* Projects Page - FIXED CENTERING & VISIBILITY */
.projects-content {
    max-width: 1000px;
    text-align: center;
    width: 100%;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 25px;
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px;
}

.project-card {
    background: var(--background-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.project-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.project-card.featured {
    border-color: var(--primary-color);
}

.project-image {
    height: 130px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.project-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary-color);
    color: var(--text-light);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.project-content {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.project-card h3 {
    color: var(--text-light);
    margin-bottom: 10px;
    font-size: 1.2rem;
    text-align: center;
}

.project-card p {
    color: var(--text-gray);
    margin-bottom: 12px;
    line-height: 1.5;
    font-size: 0.9rem;
    text-align: center;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    justify-content: center;
}

.tech-tag {
    background: var(--background-dark);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* FIXED: Coming Soon Cards - Perfect Centering */
.coming-soon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.coming-soon-content {
    text-align: center;
    color: var(--text-gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
}

.coming-soon-content i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

.coming-soon-content h3 {
    color: var(--text-light);
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
    text-align: center;
    width: 100%;
}

.coming-soon-content p {
    font-size: 0.9rem;
    text-align: center;
    width: 100%;
}

/* Contact Page - FIXED CENTERING */
.contact-content {
    max-width: 800px;
    text-align: center;
    width: 100%;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 25px;
    width: 100%;
    max-width: 600px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    background: var(--background-light);
    border-radius: var(--border-radius);
    transition: var(--transition);
    text-align: left;
}

.contact-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.contact-icon {
    width: 45px;
    height: 45px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--text-light);
    flex-shrink: 0;
}

.contact-details {
    flex: 1;
    min-width: 0;
}

.contact-details h4 {
    color: var(--text-light);
    margin-bottom: 5px;
    font-size: 1rem;
}

.contact-details a {
    color: var(--text-gray);
    text-decoration: none;
    transition: var(--transition);
    word-break: break-all;
    font-size: 0.9rem;
}

.contact-details a:hover {
    color: var(--primary-color);
}

/* Responsive Design - FIXED MOBILE LAYOUT */
@media (max-width: 768px) {
    .home-title {
        font-size: 2.3rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .about-details {
        grid-template-columns: 1fr;
    }

    .contact-info {
        grid-template-columns: 1fr;
    }

    /* FIXED: Navigation buttons - not blocked by screen edges */
    .nav-buttons {
        bottom: 15px;
        left: 10px;
        right: 10px;
        gap: 6px;
        padding: 0 5px;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
        max-width: 110px;
    }

    .profile-image {
        width: 150px;
        height: 150px;
    }

    /* FIXED: Better centering for all pages on mobile */
    .page {
        padding: 15px;
        justify-content: center;
        padding-top: 30px;
        padding-bottom: 70px;
    }

    .home-content,
    .about-content,
    .skills-content,
    .projects-content,
    .contact-content {
        padding: 0 10px;
        width: 100%;
    }

    .about-text {
        text-align: center;
        padding: 0 10px;
    }

    /* FIXED: Projects page not blocked on mobile */
    .projects-content {
        padding: 0 10px;
        width: 100%;
    }

    .projects-grid {
        margin-top: 15px;
        max-height: 65vh;
    }

    .project-card {
        margin: 0 auto;
        max-width: 100%;
    }

    /* FIXED: Contact page better centering on mobile */
    .contact-content {
        padding: 0 10px;
        width: 100%;
    }

    .contact-item {
        justify-content: center;
        text-align: center;
        flex-direction: column;
        gap: 10px;
    }

    .contact-details {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .home-title {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .profile-image {
        width: 130px;
        height: 130px;
    }

    /* FIXED: Extra small screen navigation */
    .nav-buttons {
        bottom: 10px;
        left: 8px;
        right: 8px;
        gap: 4px;
    }

    .nav-btn {
        padding: 7px 10px;
        font-size: 0.7rem;
        max-width: 100px;
    }
    
    .page {
        padding: 10px;
        padding-top: 20px;
        padding-bottom: 60px;
    }

    /* FIXED: Extra mobile adjustments for better centering */
    .about-content,
    .projects-content,
    .contact-content {
        padding: 0 5px;
    }

    .about-text,
    .project-card p,
    .contact-details {
        text-align: center;
    }

    .contact-item {
        padding: 15px;
    }

    /* FIXED: Ensure all content fits on mobile */
    .projects-grid {
        max-height: 60vh;
        gap: 10px;
    }

    .project-card {
        min-height: 250px;
    }
}

@media (max-width: 360px) {
    /* FIXED: For very small screens */
    .nav-buttons {
        left: 5px;
        right: 5px;
        gap: 3px;
    }
    
    .nav-btn {
        padding: 6px 8px;
        font-size: 0.65rem;
        max-width: 90px;
    }
    
    .page {
        padding: 8px;
        padding-top: 15px;
        padding-bottom: 55px;
    }
}
