/* projects.css */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    /* Removes tap highlight on mobile */
}

html {
    font-size: 16px;
    /* Base font size for rem units */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    padding-top: 4.5rem;
    overflow-x: hidden;
    width: 100%;

    /* Beautiful gradient background */
    background: linear-gradient(135deg,
            #e0f7fa 0%,
            #e1f5fe 20%,
            #f3e5f5 40%,
            #fff1f1 60%,
            #e8f5e9 80%,
            #e3f2fd 100%);

    /* Animated gradient version - uncomment to use */
    /*
    background: linear-gradient(
        135deg,
        #e0f7fa 0%,
        #e1f5fe 20%,
        #f3e5f5 40%,
        #fff1f1 60%,
        #e8f5e9 80%,
        #e3f2fd 100%
    );
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    */
}

/* Add these keyframes if you want the animated version */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Add a subtle pattern overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image:
        linear-gradient(to right,
            rgba(255, 255, 255, 0.1) 1px,
            transparent 1px),
        linear-gradient(to bottom,
            rgba(255, 255, 255, 0.1) 1px,
            transparent 1px);
    background-size: 50px 50px;
}

/* Back Button - Mobile Optimized */
.back-button {
    position: fixed;
    top: 1rem;
    left: 1rem;
    padding: 0.75rem 1.25rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    z-index: 1000;
    /* Mobile touch optimization */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.back-button:hover,
.back-button:active {
    background-color: #2980b9;
    transform: translateX(-5px);
}

.back-button::before {
    content: "←";
    font-size: 1.25rem;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    /* Smaller padding on mobile */
}

/* Section Styles */
.section {
    padding: 3rem 0;
    /* Reduced padding on mobile */
}

.section-subtitle {
    color: #3498db;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 1rem;
    color: #2c3e50;
    padding: 0 1rem;
}

.section-text {
    text-align: center;
    color: #666;
    max-width: 700px;
    margin: 0 auto 2rem;
    font-size: 1rem;
    padding: 0 1rem;
}

/* Portfolio List */
.portfolio-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    list-style: none;
    padding: 0 0.5rem;
}

/* Portfolio Cards */
.portfolio-card {
    position: relative;
    height: 300px;
    /* Shorter height for mobile */
    border-radius: 12px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    text-decoration: none;
    display: block;
    transition: transform 0.3s ease;
    /* Better touch handling */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.portfolio-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.9),
            rgba(0, 0, 0, 0.4));
    opacity: 1;
    /* Always visible gradient for better text readability */
    transition: opacity 0.3s ease;
}

/* Modified hover states for touch devices */
@media (hover: hover) {
    .portfolio-card:hover {
        transform: translateY(-5px);
    }

    .portfolio-card:hover::before {
        opacity: 0.95;
    }
}

/* Active state for touch devices */
.portfolio-card:active {
    transform: scale(0.98);
}

/* Card Content */
.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    color: white;
}

.card-subtitle {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

/* Button Link */
.btn-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: white;
    font-size: 1rem;
    transition: gap 0.3s ease;
    padding: 0.5rem 0;
    /* Larger touch target */
}

.btn-link:active {
    gap: 0.875rem;
}

.btn-link ion-icon {
    font-size: 1.25rem;
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    html {
        font-size: 15px;
        /* Slightly smaller base font size */
    }

    .portfolio-list {
        grid-template-columns: 1fr;
        /* Single column on mobile */
        gap: 1rem;
    }

    .portfolio-card {
        height: 250px;
        /* Even shorter on mobile */
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    body {
        padding-top: 4rem;
    }

    .section {
        padding: 2rem 0;
    }

    .back-button {
        padding: 0.625rem 1rem;
    }

    .card-content {
        padding: 1.25rem;
    }

    /* Optimize touch targets */
    .btn-link {
        padding: 0.75rem 0;
    }
}

/* Better animations for mobile */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.portfolio-card {
    animation: fadeIn 0.4s ease-out;
}

/* Smooth image loading */
.portfolio-card {
    background-color: #eee;
    transition: background-image 0.2s ease;
}

/* Add smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Prevent content shifting */
.portfolio-list {
    min-height: 300px;
}

/* Loading state */
.portfolio-card.loading {
    background-color: #f0f0f0;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0.6;
    }
}