/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Banner */
.header-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.header-banner .container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 40px;
}

.profile-section {
    display: flex;
    align-items: center;
    gap: 40px;
    flex: 1;
    justify-content: center;
}

.profile-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: high-quality;
}

.profile-info {
    text-align: left;
    flex: 1;
    min-width: 300px;
}

.profile-info h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.profile-info h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    opacity: 0.9;
    font-weight: 400;
}

.contact-info {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-info span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.social-links-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.social-links {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.social-links a {
    color: white;
    font-size: 2rem;
    transition: transform 0.3s ease, opacity 0.3s ease;
    text-decoration: none;
}

.social-links a:hover {
    transform: translateY(-5px);
    opacity: 0.8;
}

/* Sticky Navigation */
.sticky-nav {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 0;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-link {
    color: #4a5568;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.nav-link.active {
    background: #667eea;
    color: white;
}

/* Main Content */
.main-content {
    padding: 80px 0;
}

/* Project Category Sections */
.project-category {
    margin-bottom: 60px;
}

.category-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px 0;
}

.category-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.category-description {
    font-size: 1.1rem;
    color: #718096;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.projects-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #2d3748;
}

/* Projects Container - Single Column Layout */
.projects-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 50px;
    padding: 0 20px;
}

.project-row {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    min-height: 200px;
}

.project-row:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.thumbnail-link {
    display: block;
    flex-shrink: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.thumbnail-link:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.project-thumbnail {
    width: 250px;
    height: 250px;
    object-fit: contain;
    object-position: center;
    background-color: #f7fafc;
    border-radius: 8px;
    transition: inherit;
}

.project-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-header {
    margin-bottom: 15px;
}

.project-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2d3748;
}

.project-description {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 15px;
}

.project-technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tech-tag {
    background: #e2e8f0;
    color: #4a5568;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.bitbucket-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2d3748;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
    align-self: flex-start;
}

.bitbucket-link:hover {
    background: #1a202c;
}

.demo-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #667eea;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
    align-self: flex-start;
}

.demo-link:hover {
    background: #5a67d8;
}

/* Legacy grid styles - keep for backwards compatibility but hide */
.projects-grid {
    display: none;
}

.project-card {
    display: none;
}

/* Footer */
.footer {
    background: #2d3748;
    color: white;
    padding: 50px 0 30px;
    text-align: center;
}

.footer h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.skill-tag {
    background: #4a5568;
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.skill-tag:hover {
    background: #667eea;
}

.footer p {
    margin-top: 30px;
    opacity: 0.8;
    border-top: 1px solid #4a5568;
    padding-top: 20px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* Mobile-first optimizations for Brave mobile */
.nav-link, .bitbucket-link, .demo-link, .social-links a {
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
    tap-highlight-color: rgba(102, 126, 234, 0.3);
}

/* Improve touch targets for mobile */
.nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links a {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bitbucket-link, .demo-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Improve mobile hover states with active states */
@media (hover: none) and (pointer: coarse) {
    .project-row:hover {
        transform: none;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    }
    
    .thumbnail-link:hover {
        transform: none;
        opacity: 1;
    }
    
    .nav-link:hover {
        transform: none;
    }
    
    .social-links a:hover {
        transform: none;
    }
    
    /* Add active states for mobile */
    .nav-link:active {
        background: rgba(102, 126, 234, 0.2);
        transform: scale(0.98);
    }
    
    .bitbucket-link:active, .demo-link:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .social-links a:active {
        transform: scale(0.95);
    }
}

/* Fix font loading fallbacks for Brave mobile */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .projects-container {
        padding: 0 15px;
    }
    
    .project-row {
        flex-direction: column;
        min-height: auto;
    }
    
    .project-thumbnail {
        width: 100%;
        height: 250px;
        object-fit: cover;
    }
    
    .project-content {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    /* Improve mobile navigation */
    .nav-links {
        gap: 8px;
        padding: 12px 0;
        justify-content: space-between;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .nav-links::-webkit-scrollbar {
        display: none;
    }
    
    .nav-link {
        font-size: 0.75rem;
        padding: 8px 10px;
        white-space: nowrap;
        flex-shrink: 0;
        min-width: fit-content;
    }
    
    .header-banner .container {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .profile-section {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .profile-image {
        width: 180px;
        height: 180px;
    }

    .profile-info {
        text-align: center;
        min-width: auto;
    }

    .profile-info h1 {
        font-size: 2.2rem;
    }

    .contact-info {
        flex-direction: column;
        gap: 12px;
    }
    
    .contact-info span {
        font-size: 0.9rem;
        justify-content: center;
    }

    .projects-container {
        padding: 0 10px;
        gap: 30px;
    }

    .project-row {
        flex-direction: column;
        min-height: auto;
        margin: 0;
    }

    .project-thumbnail {
        width: 100%;
        height: 200px;
        object-fit: cover;
    }

    .project-content {
        padding: 15px;
    }
    
    .project-title {
        font-size: 1.2rem;
        line-height: 1.3;
    }
    
    .project-description {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .tech-tag {
        font-size: 0.8rem;
        padding: 4px 10px;
        margin: 2px;
    }
    
    .project-links {
        gap: 12px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .bitbucket-link, .demo-link {
        padding: 12px 20px;
        font-size: 0.9rem;
        text-align: center;
        justify-content: center;
        min-height: 44px;
    }
    
    /* Fix social links for mobile */
    .social-links {
        gap: 15px;
    }
    
    .social-links a {
        font-size: 1.8rem;
    }
}

/* Additional mobile optimizations for very small screens */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .header-banner {
        padding: 40px 0;
    }
    
    .profile-image {
        width: 150px;
        height: 150px;
    }
    
    .profile-info h1 {
        font-size: 1.8rem;
    }
    
    .profile-info h2 {
        font-size: 1.2rem;
    }
    
    .nav-link {
        font-size: 0.7rem;
        padding: 6px 8px;
    }
    
    .projects-container {
        gap: 25px;
    }
    
    .project-content {
        padding: 12px;
    }
}