/**
 * Overhear Firebase Integration Styles
 * Version: 1.0.1 - Fixed card content overflow in collapsed view
 */

/* Projects Grid */
.overhear-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.overhear-project-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.overhear-project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.overhear-project-card .project-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.overhear-project-card .project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overhear-project-card .project-content {
    padding: 20px;
}

.overhear-project-card .project-title {
    margin: 0 0 10px 0;
    font-size: 1.5em;
    color: #333;
}

.overhear-project-card .project-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.overhear-project-card .project-link {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.overhear-project-card .project-link:hover {
    background: #005177;
}

/* Projects List */
.overhear-projects-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
}

.overhear-project-list-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    align-items: flex-start;
}

.overhear-project-list-item .project-thumbnail {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.overhear-project-list-item .project-info {
    flex: 1;
}

.overhear-project-list-item h4 {
    margin: 0 0 10px 0;
    font-size: 1.3em;
    color: #333;
}

.overhear-project-list-item p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* Single Project Detail */
.overhear-project-detail {
    max-width: 900px;
    margin: 0 auto;
}

.overhear-project-detail .project-hero-image {
    width: 100%;
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
}

.overhear-project-detail .project-hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

.overhear-project-detail h1 {
    font-size: 2.5em;
    margin: 0 0 20px 0;
    color: #333;
}

.overhear-project-detail .project-description {
    font-size: 1.1em;
    line-height: 1.8;
    color: #555;
    margin-bottom: 30px;
}

.overhear-project-detail .project-field {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.overhear-project-detail .project-field strong {
    color: #333;
    display: inline-block;
    min-width: 120px;
}

/* Responsive */
@media (max-width: 768px) {
    .overhear-projects-grid {
        grid-template-columns: 1fr;
    }
    
    .overhear-project-list-item {
        flex-direction: column;
    }
    
    .overhear-project-list-item .project-thumbnail {
        width: 100%;
        height: 200px;
    }
    
    .overhear-project-detail h1 {
        font-size: 2em;
    }
}

/* Loading State */
.overhear-firebase-loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.overhear-firebase-loading::before {
    content: "⏳";
    font-size: 2em;
    display: block;
    margin-bottom: 10px;
}

/* Error State */
.overhear-firebase-error {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    margin: 20px 0;
}

/* Artist Gallery - Scrolling Image Gallery */
.overhear-artist-gallery {
    padding: 60px 0;
}

.artist-gallery-header {
    text-align: center;
    margin-bottom: 40px;
}

.artist-gallery-title {
    font-size: 3rem;
    font-weight: bold;
    color: #ffffff;
    margin: 0 0 20px 0;
}

.artist-gallery-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
}

.artist-gallery-container {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    overflow: hidden;
    height: 280px;
    position: relative;
}

.artist-gallery-scroll {
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    grid-auto-flow: column;
    gap: 6px;
    height: 100%;
    width: fit-content;
    padding: 6px;
    animation: scroll-gallery 60s linear infinite;
}

.artist-image {
    width: 140px !important;
    height: 140px !important;
    min-width: 140px;
    min-height: 140px;
    max-width: 140px;
    max-height: 140px;
    object-fit: cover;
    object-position: center;
    border-radius: 4px;
    display: block;
    background-color: #f5f5f5;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.artist-image:hover {
    transform: scale(1.05);
    z-index: 10;
}

@keyframes scroll-gallery {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Pause animation on hover */
.artist-gallery-container:hover .artist-gallery-scroll {
    animation-play-state: paused;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .artist-gallery-container {
        height: 240px;
    }
    
    .artist-image {
        width: 120px !important;
        height: 120px !important;
        min-width: 120px;
        min-height: 120px;
        max-width: 120px;
        max-height: 120px;
    }
    
    .artist-gallery-scroll {
        gap: 4px;
        padding: 4px;
    }
    
    .artist-gallery-title {
        font-size: 2rem;
    }
    
    .artist-gallery-subtitle {
        font-size: 1rem;
    }
}

/* ========================================
   PROJECTS GRID STYLES
   ======================================== */

.overhear-projects-section {
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.projects-header {
    text-align: center;
    margin-bottom: 50px;
}

.projects-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.projects-subtitle {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 40px;
    position: relative;
    padding: 0 160px; /* Add padding to accommodate the QR codes further out */
}

.projects-list .project-row:first-child {
    margin-top: 20px; /* Add extra padding to the first project */
}

.projects-list.collapsed {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: visible;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f5f5f5;
    padding: 0 160px; /* Add padding to accommodate the QR codes further out */
}

.projects-list.collapsed .project-row {
    min-height: 200px; /* Ensure cards maintain minimum height */
    flex-shrink: 0; /* Prevent cards from shrinking */
    height: auto; /* Allow natural height */
}

.projects-list.collapsed .project-content {
    min-height: 140px; /* Ensure content area maintains height */
    flex-shrink: 0; /* Prevent content from shrinking */
}

.projects-list.collapsed::-webkit-scrollbar {
    width: 8px;
}

.projects-list.collapsed::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

.projects-list.collapsed::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.projects-list.collapsed::-webkit-scrollbar-thumb:hover {
    background: #999;
}


.projects-expand-toggle {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    padding: 15px 0;
}

.projects-toggle-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-raleway);
}

.projects-toggle-btn:hover {
    background: #388E3C;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.projects-toggle-btn:active {
    transform: translateY(0);
}

.projects-toggle-btn .icon {
    transition: transform 0.3s ease;
    display: inline-block;
}

.projects-toggle-btn.expanded .icon {
    transform: rotate(180deg);
}

.project-row {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    transition: all 0.3s ease;
    display: flex;
    gap: 30px;
    align-items: flex-start;
    position: relative;
    overflow: visible;
    /* margin: 20px 0; */
    min-height: 200px;
}

.project-row:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border-color: #4CAF50;
}

.project-row.project-archived {
    opacity: 0.85;
}

.project-row.project-archived:hover {
    border-color: #999;
}

.archived-banner {
    position: absolute;
    top: 30px;
    right: -40px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 8px 50px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transform: rotate(45deg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* Position archived banner opposite to project icon */
.project-row.project-archived .archived-banner {
    right: -40px;
    left: auto;
    transform: rotate(45deg);
}

/* For even rows, project icon is on right, so archived banner goes on left */
.project-row.project-archived:nth-child(even) .archived-banner {
    right: auto;
    left: -40px;
    transform: rotate(-45deg);
}

/* QR Code Styling */
.project-qr {
    position: absolute;
    top: 15px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 5;
    transition: transform 0.3s ease;
}

.project-qr:hover {
    transform: scale(1.05);
}

.project-qr img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

/* Alternate positioning for QR codes */
.project-row:nth-child(even) .project-qr {
    right: auto;
    left: -60px;
}

.project-row:nth-child(even) .project-icon {
    right: -40px;
    left: auto;
}

.project-icon {
    width: 200px;
    height: 200px;
    min-width: 200px;
    min-height: 200px; /* Ensure consistent height */
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 20px;
    overflow: hidden;
    position: absolute;
    z-index: 3;
    transform: scale(1.1);
    transition: all 0.3s ease;
}

.project-row:nth-child(odd) .project-icon {
    left: -100px;
    top: 50%;
    transform: translateY(-50%) scale(1.1);
}

.project-row:nth-child(even) .project-icon {
    right: -100px;
    top: 50%;
    transform: translateY(-50%) scale(1.1);
}

.project-icon img {
    width: 200px !important;
    height: 200px !important;
    object-fit: contain !important;
    border-radius: 20px;
    background: transparent;
    display: block;
}

.project-row:nth-child(odd) .project-icon:hover {
    transform: translateY(-50%) scale(1.2);
}

.project-row:nth-child(even) .project-icon:hover {
    transform: translateY(-50%) scale(1.2);
}

.project-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* gap: 15px; */
    margin-left: 120px;
    margin-right: 120px;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* gap: 20px; */
}

.project-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.2;
    font-family: var(--font-sifonn);
}

.project-description {
    font-size: 1rem;
    color: #666;
    line-height: 1.7;
    font-family: var(--font-raleway);
}

.project-pin-count {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 0.9rem;
    white-space: nowrap;
    font-family: var(--font-raleway);
}

.pin-icon {
    font-size: 1.1rem;
}

.pin-count {
    font-weight: 500;
}

.project-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-authors,
.project-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.9rem;
}

.meta-label {
    font-weight: 600;
    color: #1a1a1a;
    margin-right: 5px;
}

.author-list {
    color: #4CAF50;
    font-weight: 500;
}

.project-tag {
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #555;
    transition: background 0.2s ease;
}

.project-tag:hover {
    background: #e0e0e0;
}

.project-tag-more {
    background: #4CAF50;
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.overhear-projects-empty {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.2rem;
    color: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .overhear-projects-section {
        padding: 40px 15px;
    }
    
    .projects-title {
        font-size: 2rem;
    }
    
    .projects-list {
        gap: 20px;
        padding: 0 20px; /* Reduce padding on mobile */
    }
    
    .projects-list.collapsed {
        padding: 0 20px; /* Reduce padding on mobile */
    }
    
    .project-row {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
        /* margin: 20px 0; */
    }
    
    .project-content {
        margin-left: 0;
        margin-right: 0;
    }
    
    .project-icon {
        width: 120px;
        height: 120px;
        min-width: 120px;
        position: relative;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        transform: scale(1) !important;
        order: 0 !important;
        align-self: center;
        margin: 0 auto;
    }
    
    .project-icon:hover {
        transform: scale(1.05) !important;
    }
    
    .project-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .project-name {
        font-size: 1.3rem;
    }
    
    .project-pin-count {
        align-self: flex-start;
    }
}



