@import url("main.css");

/* ===================================================================
   1. PROJECT GRID & CARD STYLES (for projects.html)
   ================================================================= */
.section-subtitle {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--mb-4);
    color: var(--text-light-gray);
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    line-height: 1.6;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.project-card {
    background: var(--card-bg-2);
    border: 1px solid var(--border-color-2);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition-ease);
    box-shadow: 0 6px 16px var(--shadow-initial);
    position: relative;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px var(--glow-color);
    border-color: var(--accent-gold);
}

.project-image-container {
    width: 100%;
    max-height: 320px; /* Slightly taller for carousel */
    overflow: hidden;
    background: var(--card-bg);
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-carousel {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
    padding-bottom: 0.5rem;
}

.image-carousel::-webkit-scrollbar {
    height: 8px;
}

.image-carousel::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 4px;
}

.image-carousel::-webkit-scrollbar-track {
    background: var(--border-color-2);
}

.device-frame {
    flex: 0 0 auto;
    width: 60%; /* Adjusted for multiple frames */
    max-width: 200px; /* Smaller for carousel */
    aspect-ratio: 9 / 16; /* Mobile screenshot ratio */
    border-radius: 20px;
    border: 2px solid var(--border-color-2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    background: var(--black-color);
    scroll-snap-align: center;
    transition: var(--transition-ease);
}

.device-frame:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 6px 16px var(--glow-color);
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: var(--transition-ease);
}

.project-card:hover .project-image {
    transform: scale(1.03);
}

.project-image[src*="placeholder"] {
    opacity: 0.7;
    filter: grayscale(20%);
}

.project-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-info h3 {
    font-family: var(--font-headings);
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    color: var(--text-primary);
    margin: 0;
}

.project-info p {
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
    color: var(--text-light-gray);
    line-height: 1.5;
    margin: 0;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tags span {
    background: rgba(var(--accent-gold-rgb), 0.15);
    color: var(--accent-gold);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: var(--font-medium);
    transition: var(--transition-ease);
}

.project-tags span:hover {
    background: rgba(var(--accent-gold-rgb), 0.3);
}

/* ===================================================================
   2. PROJECT DETAILS STYLES (for project-details.html)
   ================================================================= */
.project-title-details {
    text-align: center;
    font-family: var(--font-headings);
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--text-primary);
    margin-bottom: var(--mb-2);
}

.project-subtitle-details {
    text-align: center;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-light-gray);
    margin-bottom: var(--mb-4);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-container {
    margin-bottom: var(--mb-5);
}

.main-image-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto var(--mb-3);
    display: flex;
    justify-content: center;
}

.main-image-wrapper .device-frame {
    width: 80%;
    max-width: 300px;
    aspect-ratio: 9 / 16;
    border-radius: 20px;
    border: 2px solid var(--border-color-2);
    box-shadow: 0 4px 12px var(--shadow-initial);
    overflow: hidden;
    background: var(--black-color);
}

.main-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: var(--transition-ease);
}

.main-image-wrapper img:hover {
    box-shadow: 0 6px 16px var(--glow-color);
}

.thumbnail-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.thumbnail-image {
    width: 100%;
    aspect-ratio: 9 / 16; /* Match mobile screenshot ratio */
    border-radius: 12px;
    border: 1px solid var(--border-color-2);
    cursor: pointer;
    transition: var(--transition-ease);
    opacity: 0.8;
}

.thumbnail-image:hover,
.thumbnail-image.active {
    opacity: 1;
    border-color: var(--accent-gold);
    transform: scale(1.03);
    box-shadow: 0 4px 12px var(--glow-color);
}

.project-info {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    max-width: 900px;
    margin: 2rem auto;
}

.project-technologies h2,
.project-description h2 {
    font-family: var(--font-headings);
    font-size: clamp(1.5rem, 3.5vw, 1.75rem);
    color: var(--text-primary);
    margin-bottom: var(--mb-2);
    border-bottom: 2px solid var(--border-color-2);
    padding-bottom: 0.5rem;
}

.project-technologies-list {
    list-style: none;
    padding: 0;
}

.project-technologies-list li {
    background: var(--card-bg-2);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    color: var(--text-light-gray);
    font-size: 0.95rem;
    border-left: 3px solid var(--accent-gold);
    transition: var(--transition-ease);
}

.project-technologies-list li:hover {
    background: rgba(var(--accent-gold-rgb), 0.1);
}

.project-description p {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    color: var(--text-light-gray);
    line-height: 1.6;
}

.btn-project {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent-gold);
    color: var(--black-color);
    border: 1px solid var(--accent-gold);
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: var(--font-medium);
    text-align: center;
    transition: var(--transition-ease);
}

.btn-project:hover {
    background: transparent;
    color: var(--accent-gold);
    transform: translateY(-2px);
}

.btn-project i {
    font-size: 1.25rem;
}

/* ===================================================================
   3. RESPONSIVENESS
   ================================================================= */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .project-info {
        grid-template-columns: 1fr;
    }

    .thumbnail-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }

    .device-frame {
        width: 80%;
        max-width: 180px;
    }

    .main-image-wrapper .device-frame {
        width: 85%;
        max-width: 280px;
    }
}

@media (max-width: 768px) {
    .project-title-details {
        font-size: clamp(1.75rem, 4.5vw, 2.25rem);
    }

    .project-subtitle-details {
        font-size: clamp(0.9rem, 2.5vw, 1rem);
    }

    .project-info {
        gap: 1.5rem;
    }

    .main-image-wrapper {
        max-width: 100%;
    }

    .device-frame {
        width: 85%;
        max-width: 160px;
    }

    .main-image-wrapper .device-frame {
        width: 90%;
        max-width: 240px;
    }

    .image-carousel {
        gap: 0.75rem;
    }
}

@media (max-width: 500px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        padding: 1rem;
    }

    .project-info h3 {
        font-size: 1.25rem;
    }

    .thumbnail-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    }

    .device-frame {
        width: 90%;
        max-width: 140px;
    }

    .main-image-wrapper .device-frame {
        width: 95%;
        max-width: 200px;
    }

    .btn-project {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .image-carousel {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        max-height: 300px;
        scroll-snap-type: y mandatory;
    }

    .image-carousel::-webkit-scrollbar {
        width: 8px;
    }
}

/* ===================================================================
   4. MICRO-INTERACTIONS
   ================================================================= */
@keyframes glow {
    0% { box-shadow: 0 0 8px var(--glow-color); }
    50% { box-shadow: 0 0 16px var(--glow-color); }
    100% { box-shadow: 0 0 8px var(--glow-color); }
}

.project-card:hover,
.thumbnail-image:hover,
.thumbnail-image.active,
.device-frame:hover {
    animation: glow 1.5s ease-in-out infinite;
}