/* Portfolio Page Specific Styles */

/* Portfolio page layout */
.portfolio-page {
    background: linear-gradient(120deg, #f7f9fb 60%, #eebbc3 100%);
    min-height: 100vh;
}

.portfolio-header {
    text-align: center;
    padding: 2rem 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 2rem;
}

.portfolio-header h1 {
    color: #232946;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.portfolio-header p {
    color: #666;
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.back-home {
    display: inline-block;
    /* margin-top: 2rem; */
    padding: 0.8rem 1.5rem;
    background: #232946;
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.back-home:hover {
    background: #eebbc3;
    color: #232946;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(35, 41, 70, 0.2);
}

/* GitHub button styling to match back-home */
.github-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0;
}

.github-btn i {
    font-size: 1rem;
}

.portfolio-main {
    padding: 2rem 0 4rem 0;
}

/* Enhanced Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.portfolio-item {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(35,41,70,0.10);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.3s ease-out;
    animation-fill-mode: both;
}

.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(35,41,70,0.15);
}

.portfolio-image {
    background: linear-gradient(135deg, #232946 0%, #eebbc3 100%);
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.portfolio-icon {
    font-size: 3rem;
    color: #fff;
    opacity: 0.9;
    /* Disabled animation to prevent flash during navigation */
    animation: none;
    will-change: auto;
}

.portfolio-content {
    padding: 1.5rem;
}

.portfolio-content h3 {
    color: #232946;
    margin: 0 0 1rem 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.portfolio-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* GitHub link styling - different from background */
.portfolio-content p a[href*="github"] {
    color: #232946 !important;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid #667eea;
    transition: all 0.3s ease;
    padding: 2px 4px;
    border-radius: 4px;
}

.portfolio-content p a[href*="github"]:hover {
    color: #667eea !important;
    background: rgba(102, 126, 234, 0.1);
    border-bottom-color: #232946;
    transform: translateY(-1px);
}

.portfolio-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.portfolio-tech span {
    background: #f7f9fb;
    color: #232946;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #eebbc3;
    transition: all 0.3s ease;
}

.portfolio-tech span:hover {
    background: #eebbc3;
    color: #fff;
    transform: translateY(-2px);
}

/* Mobile Projects Section - Enhanced */
.mobile-projects {
    background: linear-gradient(135deg, #f8f9fc 0%, #e8ebf4 50%, #dde2ee 100%);
    color: #232946;
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}

.mobile-projects::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 25% 25%, rgba(238, 187, 195, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 75% 75%, rgba(102, 126, 234, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 1.5rem 0;
    border-bottom: 2px solid rgba(238, 187, 195, 0.3);
    transition: all 0.4s ease;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.collapsible-header:hover {
    border-bottom-color: #eebbc3;
    transform: translateY(-2px);
}

.collapsible-header h2 {
    margin: 0;
    font-size: 2.2rem;
    background: linear-gradient(45deg, #232946, #667eea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.collapsible-header i {
    font-size: 1.4rem;
    color: #eebbc3;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#flutter-arrow.rotated {
    transform: rotate(180deg);
    color: #fff;
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.collapsible-content.expanded {
    max-height: 2000px;
    padding-top: 3rem;
}

.flutter-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.flutter-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(238, 187, 195, 0.3);
    border-radius: 24px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(35, 41, 70, 0.1);
}

.flutter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #eebbc3, #667eea, #764ba2);
    background-size: 200% 100%;
    animation: gradient-shift 4s ease infinite;
    will-change: background-position;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.flutter-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(35, 41, 70, 0.15);
    border-color: rgba(238, 187, 195, 0.5);
    background: rgba(255, 255, 255, 0.9);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

.card-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #eebbc3, #667eea);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(238, 187, 195, 0.3);
}

.card-icon i {
    font-size: 1.5rem;
    color: #fff;
}

.card-header h3 {
    font-size: 1.8rem;
    margin: 0;
    color: #232946;
    font-weight: 700;
}

.project-type {
    background: rgba(238, 187, 195, 0.15);
    color: #232946;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(238, 187, 195, 0.4);
    margin-left: auto;
}

.phone-mockup {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: flex-start;
    margin-top: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.phone-screen {
    position: relative;
    width: 120px;
    height: 200px;
    background: linear-gradient(145deg, #2d3561, #1a1f3a);
    border-radius: 20px;
    padding: 8px;
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: visible;
}

.phone-screen::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.phone-screen:hover {
    transform: scale(1.8) translateY(-10px);
    box-shadow:
        0 20px 50px rgba(238, 187, 195, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.phone-screenshot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.phone-screen:hover .phone-screenshot {
    transform: scale(1);
}

.card-content p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.tech-tag {
    background: linear-gradient(135deg, rgba(238, 187, 195, 0.2), rgba(102, 126, 234, 0.2));
    color: #232946;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(238, 187, 195, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-tag:hover {
    background: linear-gradient(135deg, rgba(238, 187, 195, 0.3), rgba(102, 126, 234, 0.3));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(238, 187, 195, 0.2);
}

/* Portfolio Responsive Design */
@media (max-width: 768px) {
    .portfolio-header h1 {
        font-size: 2rem;
    }
    
    .portfolio-header p {
        font-size: 1rem;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .portfolio-item {
        margin: 0 auto;
        max-width: 400px;
    }
    
    .flutter-showcase {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .collapsible-header h2 {
        font-size: 1.8rem;
    }
    
    .phone-mockup {
        gap: 0.8rem;
    }
    
    .phone-screen {
        width: 100px;
        height: 170px;
    }
    
    .flutter-card {
        padding: 1.5rem;
    }
    
    .card-header h3 {
        font-size: 1.5rem;
    }
}

@media (min-width: 1400px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Page transition optimizations */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', Arial, sans-serif;
    margin: 0;
    background: linear-gradient(120deg, #f7f9fb 60%, #eebbc3 100%);
    color: #222;
    overflow-x: hidden;
}

/* Smooth scrolling without flash */
html {
    scroll-behavior: smooth;
}

/* Remove any flash effects during navigation */
.no-transition * {
    transition: none !important;
    animation: none !important;
}

/* Smooth navigation without flash */
body {
    /* Prevent flash during page loads */
    background-attachment: fixed;
}

/* Optimize transitions to prevent flash */
.portfolio-item,
.portfolio-icon,
.back-home,
.github-btn,
.tech-tag,
.phone-screen {
    /* Use transform-only animations to prevent layout shift */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Ensure consistent rendering */
.portfolio-item {
    contain: layout style paint;
}

/* Portfolio item animation states - disabled for smoother navigation */
.portfolio-item {
    opacity: 1;
    transform: translateY(0);
    /* Removed transitions to prevent flash during navigation */
}

.portfolio-item.animate-in {
    /* Disabled animation to prevent flash */
    animation: none;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .portfolio-icon {
        animation: none;
    }
    
    .portfolio-item {
        animation: none;
    }
    
    .flutter-card::before {
        animation: none;
    }
}
