/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    /* German language support for long words */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

html {
    scroll-behavior: smooth;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.nav-logo:hover {
    transform: scale(1.05);
}

.nav-logo h2 {
    color: #6366f1;
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #6366f1;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: #6366f1;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    position: relative;
    color: white;
    overflow: hidden;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(30px);
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    opacity: 0;
    transform: translateY(30px);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    opacity: 0;
    transform: translateY(30px);
}

.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #fff;
    color: #6366f1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: #6366f1;
    transform: translateY(-2px);
}

.hero-image {
    position: relative;
    height: 400px;
    opacity: 0;
    transform: translateX(50px);
}

.floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: float 6s ease-in-out infinite;
}

.floating-card i {
    font-size: 2rem;
    color: white;
}

.card-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.card-2 {
    top: 50%;
    right: 20%;
    animation-delay: 2s;
}

.card-3 {
    bottom: 20%;
    left: 30%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.hero-wave svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 120px;
}

.hero-wave svg path {
    fill: #f8fafc;
}

/* Animations */
.animate-fade-up {
    animation: fadeUp 1s ease forwards;
}

.animate-fade-left {
    animation: fadeLeft 1s ease forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Section Styles */
section {
    padding: 5rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
}

/* About Section */
.about {
    background: #f8fafc;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #1f2937;
}

.about-text p {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.about-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #6366f1;
    margin-bottom: 0.5rem;
}

.stat-text {
    color: #6b7280;
    font-weight: 500;
}

.about-image {
    display: flex;
    justify-content: center;
}

.image-placeholder {
    background: #e5e7eb;
    border-radius: 20px;
    padding: 4rem 2rem;
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.image-placeholder i {
    font-size: 4rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.image-placeholder p {
    color: #6b7280;
    font-weight: 500;
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.service-icon i {
    font-size: 1.5rem;
    color: white;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #1f2937;
}

.service-card p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.service-card ul {
    list-style: none;
}

.service-card li {
    color: #6b7280;
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}

.service-card li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

/* Projects Section */
.projects {
    background: #f8fafc;
}

.project-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn.active,
.filter-btn:hover {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.project-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.project-image {
    position: relative;
    height: 250px;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-image i {
    font-size: 3rem;
    color: #9ca3af;
}

.project-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 2rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.project-item:hover .project-overlay {
    transform: translateY(0);
}

/* Mobile-friendly project overlay - hide by default, show on click */
@media (hover: none) and (pointer: coarse), (max-width: 768px) {
    .project-overlay {
        transform: translateY(100%);
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
        position: absolute;
        padding: 1.5rem;
        transition: transform 0.3s ease;
    }
    
    .project-item {
        position: relative;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Show overlay when active (clicked) */
    .project-item.active .project-overlay {
        transform: translateY(0);
    }
    
    /* Add visual feedback when touched */
    .project-item.touched {
        transform: scale(1.02);
    }
}

/* Show overlay on active/focus for touch devices */
.project-item:active .project-overlay,
.project-item:focus .project-overlay,
.project-item.touched .project-overlay {
    transform: translateY(0);
}

/* Service card touch effects */
.service-card.touched {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Better mobile tap targets */
@media (max-width: 768px) {
    .project-item {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    
    .service-card {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Make overlay more visible on mobile */
    .project-overlay {
        backdrop-filter: blur(5px);
    }
}

.project-overlay h3 {
    margin-bottom: 0.5rem;
}

.project-overlay p {
    margin-bottom: 1rem;
    opacity: 0.9;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.875rem;
}

/* Testimonials */
.testimonials {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.testimonials .section-title {
    color: white;
}

.testimonials .section-subtitle {
    color: rgba(255, 255, 255, 0.9);
}

.testimonials-slider {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.testimonial-item {
    display: none;
    text-align: center;
    padding: 2rem;
}

.testimonial-item.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.testimonial-content p {
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.testimonial-author h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.testimonial-author p {
    opacity: 0.8;
    font-size: 0.9rem;
}

.testimonial-dots {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: background 0.3s ease;
}

.dot.active {
    background: white;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #1f2937;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-item i {
    font-size: 1.2rem;
    color: #6366f1;
    margin-top: 0.25rem;
}

.contact-item h4 {
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.contact-item p {
    color: #6b7280;
}

.contact-form {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 15px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.5;
    color: #374151;
    background-color: #ffffff;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6366f1;
}

.form-group textarea {
    resize: vertical;
}

/* Consistent placeholder styling */
.form-group input::placeholder,
.form-group select::placeholder,
.form-group textarea::placeholder {
    color: #9ca3af;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    opacity: 1;
}

.form-group input::-webkit-input-placeholder,
.form-group select::-webkit-input-placeholder,
.form-group textarea::-webkit-input-placeholder {
    color: #9ca3af;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

.form-group input::-moz-placeholder,
.form-group select::-moz-placeholder,
.form-group textarea::-moz-placeholder {
    color: #9ca3af;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    opacity: 1;
}

.form-group input:-ms-input-placeholder,
.form-group select:-ms-input-placeholder,
.form-group textarea:-ms-input-placeholder {
    color: #9ca3af;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

/* Footer */
.footer {
    background: #1f2937;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section p {
    color: #9ca3af;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: #374151;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.social-links a:hover {
    background: #6366f1;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1rem;
    text-align: center;
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero {
        min-height: 100vh;
        min-height: 100dvh; /* Use dynamic viewport height for better mobile support */
    }
    
    .hero-wave {
        bottom: -1px; /* Ensure no gap on mobile */
    }
    
    .hero-wave svg {
        height: 80px; /* Smaller wave on mobile */
        width: calc(100% + 2px); /* Ensure full coverage */
        margin-bottom: -1px; /* Eliminate any sub-pixel gaps */
    }
    
    .about {
        margin-top: -1px; /* Ensure sections connect seamlessly */
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
    }

    .about-stats {
        justify-content: center;
        gap: 1rem;
    }

    .services-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-filters {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .filter-btn {
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .about-stats {
        justify-content: center;
        text-align: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    /* Legal pages responsive fixes */
    .privacy-content,
    .impressum-content {
        padding: 1.5rem !important;
        margin: 0 10px !important;
    }
    
    .privacy-content h1,
    .impressum-content h1 {
        font-size: 1.8rem !important;
        line-height: 1.2 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
    }
    
    .privacy-content h2,
    .impressum-content h2 {
        font-size: 1.3rem !important;
        line-height: 1.3 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
    }
    
    .privacy-content p,
    .impressum-content p {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
    }
}

/* Extra small screens - handle very long German words */
@media (max-width: 400px) {
    .privacy-content h1,
    .impressum-content h1 {
        font-size: 1.5rem !important;
    }
    
    .privacy-content,
    .impressum-content {
        padding: 1rem !important;
        margin: 0 5px !important;
    }
    
    /* Ensure container doesn't overflow */
    .container {
        padding: 0 10px;
    }
}

/* Project Management Styles */
.project-details {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.project-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-edit {
    background: #3b82f6;
    color: white;
}

.btn-edit:hover {
    background: #2563eb;
}

.btn-delete {
    background: #ef4444;
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: #f3f4f6;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* File Upload Styles */
.file-upload-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6b7280;
    background: #f9fafb;
}

.file-upload-label:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #f0f9ff;
}

.file-info {
    margin-top: 0.5rem;
}

.file-selected {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f0f9ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    color: #1e40af;
}

.file-remove {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: auto;
}

.file-remove:hover {
    background: #dc2626;
}

/* Enhanced project overlay */
.project-overlay {
    padding: 1.5rem;
}

.project-overlay h3 {
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.project-overlay p {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

/* Add Project Button */
.add-project-btn-container {
    margin-top: 2rem;
}

#add-project-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

#add-project-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* 3D Printing specific icons and colors */
.service-icon {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.floating-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Enhanced responsive design for modals */
@media (max-width: 768px) {
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
        width: calc(100% - 2rem);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .project-actions {
        flex-direction: column;
    }
}

/* Scroll animations */
@media (prefers-reduced-motion: no-preference) {
    .animate-on-scroll {
        opacity: 0;
        transform: translateY(30px);
        transition: all 0.6s ease;
    }

    .animate-on-scroll.animated {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced mobile touch interactions */
@media (max-width: 768px) {
    .project-item {
        touch-action: manipulation;
        user-select: none;
    }
    
    .project-item::before {
        content: '';
        position: absolute;
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        content: '\f078'; /* down arrow */
        font-size: 14px;
        color: #374151;
        z-index: 10;
        transition: transform 0.3s ease;
    }
    
    .project-item.active::before {
        transform: rotate(180deg);
    }
    
    /* Add subtle animation when overlay shows */
    .project-overlay {
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    
    .project-item.active .project-overlay {
        opacity: 1;
    }
}

/* Ensure smooth transitions for all project interactions */
.project-item, .project-overlay {
    transition: all 0.3s ease;
}