:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --background-color: #ecf0f1;
    --text-color: #2c3e50;
    --header-bg: #34495e;
    --accent-color: #e74c3c;
    --gradient-start: #2980b9;
    --gradient-end: #3498db;
}

/* Add/modify these styles at the beginning after root variables */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Update header styles */
.header {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 2rem;
    margin-bottom: 2rem;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2rem;
}

.profile-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: 100%;
    padding: 1rem;
}

.header-content {
    flex: 1;
    padding: 1rem;
}

/* Update footer styles */
#foot {
    width: 100vw;
    box-sizing: border-box;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* Update project grid container */
.project-grid {
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

/* Add this to all sections */
.section {
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Fix for mobile */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
        overflow: hidden;
    }

    .project-grid {
        overflow: visible;
    }

    .profile-container {
        flex-direction: column;
        text-align: center;
        padding: 1rem 0.5rem;
        gap: 1rem;
    }

    .header-content {
        width: 100%;
        padding: 0.5rem;
        text-align: center;
    }

    #img1 {
        width: 150px;
        height: 150px;
        min-width: 150px;
        min-height: 150px;
        margin: 0 auto;
    }

    .header-content h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }

    .header-content h3 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .highlights {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .highlight-badge {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    /* Fix section padding */
    .section {
        padding: 1.5rem 1rem;
        margin: 1rem 0.5rem;
    }

    /* Adjust project cards */
    .project-card {
        padding: 1rem;
    }

    /* Fix footer layout */
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
        padding: 1rem;
    }
}

/* Global styles */
html {
    height: 100%;
    margin: 0;
    width: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    width: 100%;
}

*{
    margin: 0;
    padding: 0;
}

/* Header styles */
.header {
    background: var(--bg-secondary);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 1000;
}

#img1 {
    border-radius: 50%;
    width: 250px;
    border: 5px solid white;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    aspect-ratio: 1;
    object-fit: cover;
    height: 250px;
    flex-shrink: 0;
    min-width: 200px; /* Prevent squeezing */
    min-height: 200px; /* Prevent squeezing */
}

#img1:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
}

.header-content {
    margin-left: 2rem;
    flex: 1;
}

/* Section styles */
.section {
    background: white;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 1200px;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
    margin-bottom: 1rem;
    overflow: hidden;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    color: var(--primary-color);
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.section-content {
    line-height: 1.6;
    color: #444;
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
    max-height: 200px;
    overflow-y: auto;
    margin: 1rem 0;
    padding-right: 0.5rem;
}

.section-content::-webkit-scrollbar {
    width: 6px;
}

.section-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.section-content::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 3px;
}

/* Project styles */
.project-link {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-link:hover {
    transform: translateX(10px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.project-link img {
    width: 35px;
    transition: transform 0.3s ease;
}

.project-link img:hover {
    transform: scale(1.2);
}

/* Update Project Grid Styles */
.project-grid {
    position: relative;
    height: 500px; /* Increased height to accommodate content */
    perspective: 1000px;
    transform-style: preserve-3d;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
    margin: 0 auto;
    max-width: 1200px;
    overflow: visible;
    touch-action: none;
    user-select: none;
}

.project-card {
    position: absolute;
    width: 350px; /* Fixed width */
    min-width: initial;
    transition: all 0.5s ease;
    opacity: 0;
    transform: scale(0.8) translateX(100%) rotateY(-20deg);
    cursor: pointer;
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    left: 50%; /* Center point */
    top: 50%; /* Center point */
    will-change: transform;
    user-select: none;
    touch-action: pan-y pinch-zoom;
}

.project-card.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotateY(0);
    z-index: 3;
}

.project-card.prev {
    opacity: 0.6;
    transform: translate(-125%, -50%) scale(0.8) rotateY(20deg);
    z-index: 2;
}

.project-card.next {
    opacity: 0.6;
    transform: translate(25%, -50%) scale(0.8) rotateY(-20deg);
    z-index: 2;
}

.project-card.inactive {
    opacity: 0;
    transform: translate(-200%, -50%) scale(0.8);
    pointer-events: none;
}

/* Adjust content inside project card */
.project-card h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
    color: var(--primary-color);
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Update navigation buttons */
.project-navigation {
    position: relative;
    z-index: 4;
    margin-top: 1rem;
}

.scroll-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    margin: 0 0.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.scroll-btn:hover:not(:disabled) {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .project-grid {
        height: 450px;
    }

    .project-card {
        width: 300px;
    }

    .project-card.prev {
        transform: translate(-110%, -50%) scale(0.7) rotateY(20deg);
    }

    .project-card.next {
        transform: translate(10%, -50%) scale(0.7) rotateY(-20deg);
    }
}

@media (max-width: 480px) {
    .project-grid {
        height: 400px;
    }

    .project-card {
        width: 280px;
    }

    .project-card.prev,
    .project-card.next {
        opacity: 0.4;
    }
}

.project-navigation {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.scroll-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.scroll-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.project-grid::-webkit-scrollbar {
    height: 8px;
}

.project-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.project-grid::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

.project-grid::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Footer styles */
#foot {
    background: var(--header-bg);
    color: white;
    clip-path: polygon(0 10%, 100% 0, 100% 100%, 0% 100%);
    padding: 4rem 2rem 2rem;
    margin-top: 2rem;
    width: 100%;
    bottom: 0;
}

.footer-content {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
}

.footer-section {
    margin: 0 1rem;
}

.social-links {
    display: flex;
    gap: 1rem; /* Controls spacing between icons */
    align-items: center;
    justify-content: center;
}

.social-links img {
    width: 40px;
    margin: 0; /* Remove margin that might be creating the dash effect */
    filter: grayscale(100%);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.social-links img:hover {
    filter: grayscale(0%);
    transform: scale(1.3) rotate(360deg);
}

.highlights {
    margin-top: 1rem;
}

.highlight-badge {
    background: var(--bg-secondary);
    color: var(--accent-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    margin: 0.25rem;
    transition: all 0.3s ease;
}

.education-timeline {
    position: relative;
    padding: 2rem 0;
}

.education-card {
    background: white;
    border-left: 4px solid var(--secondary-color);
    padding: 1rem;
    margin: 1rem 0;
    position: relative;
    transition: transform 0.3s ease;
    backface-visibility: hidden;
    will-change: transform;
}

.education-card:hover {
    transform: translateX(10px);
}

.edu-year {
    color: var(--accent-color);
    font-weight: bold;
}

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

.skill-bar {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    margin-top: 0.5rem;
    position: relative;
}

.skill-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    border-radius: 4px;
    width: attr(data-level);
    animation: fillBar 1s ease-out forwards;
}

.skill-tag {
    background: #f0f0f0;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    margin: 0.3rem;
    display: inline-block;
    transition: all 0.3s ease;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.skill-tag:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backface-visibility: hidden;
    will-change: transform;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.tech-badge {
    background: #e9ecef;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
    margin: 0.2rem;
    display: inline-block;
}

@keyframes fillBar {
    from { width: 0; }
    to { width: var(--width); }
}

.experience-timeline {
    position: relative;
    padding: 2rem 0;
}

.experience-card {
    background: white;
    border-left: 4px solid var(--accent-color);
    padding: 1.5rem;
    margin: 1.5rem 0;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backface-visibility: hidden;
    will-change: transform;
}

.experience-card:hover {
    transform: translateX(10px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.exp-year {
    color: var(--secondary-color);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.exp-session {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.exp-description {
    color: #666;
    margin-top: 1rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Enhanced About Section Styles */
.about-section {
    overflow: hidden;
}

.about-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
    align-items: start;
}

.about-text {
    position: relative;
}

.about-intro {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.highlight-text {
    color: var(--accent-color);
    font-weight: bold;
}

.about-description {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 10px;
    box-shadow: 5px 5px 10px #d9d9d9, -5px -5px 10px #ffffff;
    transition: transform 0.3s ease;
}

.highlight-item:hover {
    transform: translateY(-5px);
}

.highlight-icon {
    font-size: 1.5rem;
}

.highlight-info {
    font-weight: 500;
}

.about-quote {
    font-style: italic;
    color: var(--secondary-color);
    padding: 1.5rem;
    border-left: 4px solid var(--accent-color);
    margin: 2rem 0;
    font-size: 1.1rem;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 0 10px 10px 0;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-color);
    font-size: 0.9rem;
}

/* Responsive design for about section */
@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .about-stats {
        grid-template-columns: 1fr 1fr;
    }
}

/* Enhanced Responsive Design */
@media (max-width: 1024px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        padding: 2rem 1rem;
        text-align: center;
    }

    #img1 {
        width: 200px;
        margin-bottom: 1rem;
    }

    .header-content {
        margin: 0;
    }

    .header h1 {
        font-size: 2rem;
    }

    .header h3 {
        font-size: 1.2rem;
    }

    .section {
        margin: 1rem;
        padding: 1.5rem;
    }

    .highlight-badge {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    .about-description {
        font-size: 1rem;
    }

    .about-highlights {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .education-card, .experience-card {
        padding: 1.2rem;
    }

    .project-card {
        width: calc(100% - 2rem);
        min-width: 280px;
        padding: 1.2rem;
    }

    .tech-stack {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .tech-badge {
        font-size: 0.8rem;
    }

    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    #img1 {
        width: 150px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .about-quote {
        font-size: 1rem;
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .social-links img {
        width: 35px;
    }

    .project-link {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .footer-section {
        margin: 1rem 0;
    }

    .section {
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* Optimize animations for mobile */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Project Grid Styles */
.project-grid {
    position: relative;
    height: 500px;
    perspective: 1000px;
    transform-style: preserve-3d;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
    margin: 0 auto;
    max-width: 1200px;
    overflow: visible;
    touch-action: none;
    user-select: none;
}

.project-card {
    position: absolute;
    width: 350px;
    height: max-content;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    cursor: pointer;
    top: 50%;
    left: 50%;
    transform-origin: center center;
    will-change: transform;
    user-select: none;
    touch-action: pan-y pinch-zoom;
}

.project-card.active {
    opacity: 1;
    z-index: 3;
    transform: translate(-50%, -50%) scale(1);
    filter: blur(0);
}

.project-card.prev {
    opacity: 0.45;
    z-index: 2;
    transform: translate(-150%, -50%) scale(0.8);
    filter: blur(2px);
}

.project-card.next {
    opacity: 0.45;
    z-index: 2;
    transform: translate(50%, -50%) scale(0.8);
    filter: blur(2px);
}

.project-card.inactive {
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    filter: blur(4px);
}

/* Mobile responsiveness for project cards */
@media (max-width: 768px) {
    .project-grid {
        height: 450px;
    }

    .project-card {
        width: 300px;
    }

    .project-card.prev {
        transform: translate(-130%, -50%) scale(0.7);
        opacity: 0.45;
        filter: blur(1.5px);
    }

    .project-card.next {
        transform: translate(30%, -50%) scale(0.7);
        opacity: 0.45;
        filter: blur(1.5px);
    }
}

@media (max-width: 480px) {
    .project-grid {
        height: 400px;
    }

    .project-card {
        width: 280px;
    }

    .project-card.prev,
    .project-card.next {
        opacity: 0.4;
    }
}

/* Project carousel container */
.project-carousel-container {
    position: relative;
    width: 100%;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Carousel navigation buttons */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--secondary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.carousel-nav:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
    left: 0;
}

.carousel-nav.next {
    right: 0;
}

/* Update project grid styles */
.project-grid {
    width: calc(100% - 100px); /* Make room for navigation buttons */
    margin: 0 auto;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .carousel-nav {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .project-grid {
        width: calc(100% - 80px);
    }
}

@media (max-width: 480px) {
    .carousel-nav {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .project-grid {
        width: calc(100% - 70px);
    }
}

.profile-image {
    border-radius: 50%;
    border: 4px solid var(--accent-color);
    transition: transform 0.3s ease;
}

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

/* Dark Mode Compatibility */
[data-theme="dark"] .section-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

[data-theme="dark"] .section-content::-webkit-scrollbar-thumb {
    background: var(--accent-color);
}

/* Ensure dark mode text visibility */
[data-theme="dark"] .section-content,
[data-theme="dark"] .exp-description,
[data-theme="dark"] .edu-highlights {
    color: var(--text-secondary);
}

/* Fix for white backgrounds in components */
[data-theme="dark"] .skill-category,
[data-theme="dark"] .education-timeline,
[data-theme="dark"] .experience-timeline {
    background: transparent;
}

/* Ensure proper contrast for links */
[data-theme="dark"] a {
    color: var(--accent-color);
}

[data-theme="dark"] a:hover {
    color: var(--text-primary);
}

/* Small mobile devices */
@media (max-width: 480px) {
    .profile-container {
        padding: 0.5rem;
    }

    #img1 {
        width: 120px;
        height: 120px;
        min-width: 120px;
        min-height: 120px;
    }

    .header-content h1 {
        font-size: 1.5rem;
    }

    .header-content h3 {
        font-size: 1rem;
    }

    .highlight-badge {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}

/* Container width fix */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* Fix section margins */
.section:first-of-type {
    margin-top: 1rem;
}

.section:last-of-type {
    margin-bottom: 2rem;
}