/* ============================================
   GALLERY LAYOUT
============================================ */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.gallery-card {
    padding: 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    text-align: center;
    cursor: pointer;
}

.gallery-thumb {
    width: 100%;
    max-width: 200px;
    height: auto;
    margin: 10px auto 0 auto;
    display: block;
}

.gallery-name {
    font-weight: bold;
    font-size: 1rem;
    margin-top: 6px;
}

.gallery-actions {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.gallery-btn {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 6px;
    background: #1A6F75;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.gallery-btn:hover {
    background: #207F86;
}

/* Owned state */
.add-collection-btn.owned {
    background: #06201A;
    color: white;
}

#authButtons {
    display: none;
}
/* ============================================
   FLIP CARD OVERLAY
============================================ */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
}

.overlay-content {
    width: 340px;
    height: 480px;
    position: relative;
    perspective: 1200px;
}

.flip-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.7s ease;
}

.flip-card.flipped {
    transform: rotateY(180deg);
}

.face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
}

.back {
    transform: rotateY(180deg);
}

.close-btn,
.flip-btn {
    position: absolute;
    background: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.close-btn {
    top: -40px;
    right: 0;
}

.flip-btn {
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
}

/* ============================================
   MOBILE OVERRIDES
============================================ */

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
        padding: 12px;
    }

    .gallery-thumb {
        max-width: 150px;
    }

    .gallery-card {
        padding: 8px;
    }

    .gallery-name {
        font-size: 1.1rem;
    }

    .overlay-content {
        width: 90vw !important;
        height: 140vw !important;
    }

    .flip-card,
    .face {
        width: 100% !important;
        height: 100% !important;
    }

    .close-btn {
        top: -50px;
        right: 0;
        font-size: 1.2rem;
        padding: 10px 16px;
    }

    .flip-btn {
        bottom: -60px;
        font-size: 1.2rem;
        padding: 10px 16px;
    }
}


/* ============================================
   TROUPE LIST TABLE
============================================ */

.page-title {
    text-align: center;
    margin-top: 20px;
    font-size: 1.8rem;
    font-weight: bold;
    color: #06201A;
}

.troupe-table {
    width: 90%;
    max-width: 900px;
    margin: 20px auto;
}

.troupe-header,
.troupe-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 10px;
    padding: 14px 16px;
    align-items: center;
}

.troupe-header {
    background: #14575C;
    color: white;
    font-weight: bold;
    border-radius: 8px;
}

.troupe-row {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin-top: 10px;
}

.troupe-col {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Buttons */
.troupe-actions {
    display: flex;
    gap: 10px;
}

.troupe-btn {
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s, transform 0.15s;
}


.troupe-btn.edit {
    background: #14575C;
    color: white;
}

.troupe-btn.delete {
    background: #b71c1c;
    color: white;
}

.troupe-btn:hover {
    transform: scale(1.05);
}

