/* Portfolio Page Styles - The Best of the Best Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* CSS Custom Properties for Advanced Animations */
:root {
    --primary-color: #2563eb;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-light: #999;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-accent: #e2e8f0;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Global Styles with Advanced Typography */
.portfolio-main {
    margin-top: 80px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Container with Advanced Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
}

/* Hero Section with Stunning Design */
.portfolio-hero {
    position: relative;
    padding: 8rem 0 6rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%), url('https://www.creativefabrica.com/wp-content/uploads/2020/01/30/Grand-Hotel-PowerPoint-Template-Graphics-1.jpg');
    background-size: cover;
    background-position: center;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.portfolio-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    animation: grain 20s linear infinite;
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -5%); }
    20% { transform: translate(-10%, 5%); }
    30% { transform: translate(5%, -10%); }
    40% { transform: translate(-5%, 15%); }
    50% { transform: translate(-10%, 5%); }
    60% { transform: translate(15%, 0%); }
    70% { transform: translate(0%, 10%); }
    80% { transform: translate(3%, 15%); }
    90% { transform: translate(-10%, 10%); }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.7;
    margin-top: 1.5rem;
    opacity: 0.95;
    font-weight: 400;
}

.portfolio-hero h1 {
    font-size: 5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    line-height: 1.1;
    background: linear-gradient(45deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { filter: drop-shadow(0 0 20px rgba(255,255,255,0.3)); }
    to { filter: drop-shadow(0 0 30px rgba(255,255,255,0.6)); }
}

.hero-subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 3rem;
}

.hero-subtitle code {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9em;
}

/* Floating Elements Animation - Improved for multilingual support */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    /* Prevent layout shifts with different text lengths */
    min-height: 100%;
    overflow: hidden;
}

.floating-icon {
    position: absolute;
    font-size: 3.5rem;
    opacity: 0.08;
    animation: float 8s ease-in-out infinite;
    /* Prevent text wrapping and layout issues */
    white-space: nowrap;
    line-height: 1;
    /* Ensure consistent sizing across languages */
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-icon:nth-child(1) {
    top: 15%;
    left: 8%;
    animation-delay: 0s;
}

.floating-icon:nth-child(2) {
    top: 65%;
    right: 12%;
    animation-delay: 2s;
}

.floating-icon:nth-child(3) {
    bottom: 25%;
    left: 15%;
    animation-delay: 4s;
}

.floating-icon:nth-child(4) {
    top: 35%;
    right: 18%;
    animation-delay: 6s;
}

/* Responsive adjustments for floating icons */
@media (max-width: 768px) {
    .floating-icon {
        font-size: 2.5rem;
        opacity: 0.06;
    }
    
    .floating-icon:nth-child(1) {
        top: 20%;
        left: 5%;
    }
    
    .floating-icon:nth-child(2) {
        top: 70%;
        right: 8%;
    }
    
    .floating-icon:nth-child(3) {
        bottom: 30%;
        left: 10%;
    }
    
    .floating-icon:nth-child(4) {
        top: 40%;
        right: 12%;
    }
    
    /* Ensure hero content is readable */
    .hero-content {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        line-height: 1.6;
    }
}

@media (max-width: 480px) {
    .floating-icon {
        font-size: 2rem;
        opacity: 0.05;
    }
    
    .floating-icon:nth-child(1) {
        top: 25%;
        left: 3%;
    }
    
    .floating-icon:nth-child(2) {
        top: 75%;
        right: 5%;
    }
    
    .floating-icon:nth-child(3) {
        bottom: 35%;
        left: 8%;
    }
    
    .floating-icon:nth-child(4) {
        top: 45%;
        right: 8%;
    }
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg) scale(1); 
        opacity: 0.08;
    }
    25% { 
        transform: translateY(-15px) rotate(2deg) scale(1.05); 
        opacity: 0.12;
    }
    50% { 
        transform: translateY(8px) rotate(-1deg) scale(0.98); 
        opacity: 0.06;
    }
    75% { 
        transform: translateY(-8px) rotate(1deg) scale(1.02); 
        opacity: 0.1;
    }
}

/* Portfolio Index Section */
.portfolio-index {
    padding: 6rem 0;
    background: var(--bg-secondary);
    position: relative;
}

.portfolio-index::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent, var(--bg-secondary));
}

.index-content h2 {
    font-size: 3.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4rem;
    color: var(--text-primary);
}

.index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.index-item {
    background: var(--bg-primary);
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.index-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.index-item:hover::before {
    transform: scaleX(1);
}

.index-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.index-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
    text-align: center;
}

.index-item h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.index-item p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

/* Portfolio Cases */
.portfolio-case {
    padding: 8rem 0;
    position: relative;
}

.portfolio-case:nth-child(even) {
    background: var(--bg-secondary);
}

.portfolio-case:nth-child(odd) {
    background: var(--bg-primary);
}

/* Case Header */
.case-header {
    text-align: center;
    margin-bottom: 4rem;
}

.case-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.case-category,
.case-location {
    background: var(--gradient-secondary);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.case-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    max-width: 800px;
    margin: 0 auto;
}

/* Case Hero */
.case-hero {
    margin-bottom: 4rem;
}

.hero-image-container {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    /* Ensure images stay completely still */
    transform: none !important;
    will-change: auto;
}

/* Ensure hero images never move on scroll */
.hero-image-container img,
.hero-image-container .case-study-image {
    transform: none !important;
    will-change: auto;
    position: relative;
    /* Disable any potential scroll-based animations */
    animation: none !important;
    transition: none !important;
}

/* Override any AOS or other scroll animations for hero images */
.hero-image-container[data-aos],
.hero-image-container img[data-aos],
.hero-image-container .case-study-image[data-aos] {
    transform: none !important;
    animation: none !important;
    transition: none !important;
}

/* Ensure case study sections don't move unexpectedly */
.case-hero {
    transform: none !important;
    will-change: auto;
}



.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 2rem;
    color: white;
}

.hero-caption {
    font-size: 1.1rem;
    margin: 0;
    text-align: center;
}

/* Case Summary */
.case-summary {
    margin-bottom: 4rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.summary-item {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.summary-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.summary-item:hover::before {
    transform: scaleX(1);
}

.summary-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.summary-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
}

.summary-item h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.summary-item p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Case Gallery */
.case-gallery {
    margin-bottom: 4rem;
}

.gallery-title {
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

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

.gallery-item {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}



.gallery-item figcaption {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
}

/* CTA Section */
.portfolio-cta {
    padding: 8rem 0;
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}

.portfolio-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain2" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain2)"/></svg>');
    opacity: 0.2;
    animation: grain 15s linear infinite reverse;
}

.cta-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 800px;
    margin: 0 auto;
}

.portfolio-cta h2 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 2rem;
    line-height: 1.1;
}

.portfolio-cta p {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    opacity: 0.9;
}

.portfolio-cta a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.portfolio-cta a:hover {
    text-decoration: underline;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-button {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left var(--transition-slow);
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button.primary {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.cta-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.cta-button.secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.cta-button.secondary:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Animated Background Elements */
.cta-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.floating-shape {
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: floatShape 8s ease-in-out infinite;
}

.floating-shape:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-shape:nth-child(2) {
    top: 60%;
    right: 15%;
    animation-delay: 2.5s;
}

.floating-shape:nth-child(3) {
    bottom: 30%;
    left: 20%;
    animation-delay: 5s;
}

@keyframes floatShape {
    0%, 100% { transform: translateY(0px) scale(1); opacity: 0.1; }
    50% { transform: translateY(-30px) scale(1.2); opacity: 0.3; }
}

/* Responsive Design with Advanced Breakpoints */
@media (max-width: 1200px) {
    .container {
        max-width: 1000px;
    }
    
    .portfolio-hero h1 {
        font-size: 4rem;
    }
    
    .case-title {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .portfolio-hero {
        padding: 6rem 0 4rem;
        min-height: 80vh;
    }
    
    .portfolio-hero h1 {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .index-content h2 {
        font-size: 2.5rem;
    }
    
    .case-title {
        font-size: 2.5rem;
    }
    
    .gallery-title {
        font-size: 2rem;
    }
    
    .portfolio-cta h2 {
        font-size: 2.5rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .floating-icon {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .portfolio-hero h1 {
        font-size: 2.5rem;
    }
    
    .case-title {
        font-size: 2rem;
    }
    
    .index-content h2 {
        font-size: 2rem;
    }
    
    .gallery-title {
        font-size: 1.75rem;
    }
    
    .portfolio-cta h2 {
        font-size: 2rem;
    }
    
    .portfolio-cta p {
        font-size: 1.1rem;
    }
    
    .cta-button {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
}

/* Advanced Hover Effects */
.index-item:hover .index-icon {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translate3d(0,0,0); }
    40%, 43% { transform: translate3d(0,-8px,0); }
    70% { transform: translate3d(0,-4px,0); }
    90% { transform: translate3d(0,-2px,0); }
}

/* Smooth Transitions for All Interactive Elements */
* {
    transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
}

/* Performance Optimizations */
.portfolio-main {
    will-change: transform;
    backface-visibility: hidden;
}

/* Case Study Images */
.case-study-image {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    object-fit: cover;
    min-height: 300px;
}

.case-study-image:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.hero-image-container .case-study-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--border-radius-lg);
}

.gallery-item .case-study-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

/* Print Styles */
@media print {
    .portfolio-main {
        margin-top: 0;
    }
    
    .floating-elements,
    .cta-background {
        display: none;
    }
    
    .portfolio-hero {
        background: white !important;
        color: black !important;
    }
}
