/* /assets/lab_view.css */

/* --- Заголовок сторінки --- */
.lab-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 0 20px;
}

.lab-header h1 {
    font-size: 2.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.lab-meta {
    font-size: 1rem;
    color: #888;
    margin-bottom: 20px;
}

.lab-meta strong {
    color: #ccc;
    font-weight: 500;
}

.lab-description {
    max-width: 600px;
    margin: 0 auto;
    color: #aaa;
    line-height: 1.6;
}

/* --- Галерея (використовує стилі з justified gallery) --- */
/* Тут можна додати специфічні для цієї сторінки стилі галереї, якщо потрібно */
.remove-from-lab-btn {
    top: 50px !important;
}

.gallery-item:hover .remove-from-lab-btn {
    opacity: 1;
}

.remove-from-lab-btn:hover {
    background-color: #dc3545; /* Червоний колір для видалення */
    border-color: transparent;
}

/* --- Повідомлення про порожню лабораторію --- */
.empty-lab-message {
    width: 100%;
    text-align: center;
    padding: 80px 20px;
    color: #888;
    border: 2px dashed #333;
    border-radius: 8px;
    margin: 20px 0;
}

.empty-lab-message i.bi {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
    color: #555;
}

.empty-lab-message p {
    font-size: 1.2rem;
    margin: 10px 0;
}

.empty-lab-message a {
    color: #E8BD2C;
    text-decoration: none;
    font-weight: bold;
}
.empty-lab-message a:hover {
    text-decoration: underline;
}

/* ======================================================= */
/* === СТИЛІ ДЛЯ НАКЛАДАННЯ НА КАРТКУ КАДРУ === */
/* ======================================================= */

.gallery-item {
    overflow: hidden; /* Важливо, щоб overlay не вилазив */
}

.card-img-overlay .card-title {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

.card-img-overlay .card-title a {
    color: inherit;
    text-decoration: none;
}

/* ======================================================== */
/* === ОНОВЛЕНІ СТИЛІ ДЛЯ ГАЛЕРЕЇ (v2 - з виправленнями) === */
/* ======================================================== */
.gallery-container {
    max-width: calc(100% - 50px);
    margin-left: auto;
    margin-right: auto;
    transition: max-width 0.2s ease-in-out, padding 0.2s ease-in-out;
}

/* 1. Основний контейнер галереї */
.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -5px;
}

/* 2. Оболонка елемента */
.gallery-item-wrapper {
    margin: 5px;
    box-sizing: border-box;
    position: relative;
    display: block;
    width: 426px;
    height: 240px;
    max-width: 100%;
}

/* 3. Внутрішній елемент */
.gallery-item {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 5px;
    overflow: hidden;
    background: #252525;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}
.gallery-item:hover {
    transform: scale(1.03);
}

/* 4. Саме зображення */
.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 
============================================================
=== КЛЮЧОВІ ЗМІНИ: Стилі для накладання (overlay) ===
============================================================
*/

.card-img-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 80%);
    display: flex;
    align-items: center;
    justify-content: end; 
    padding: 15px; /* Трохи зменшуємо відступи */
    text-align: center; /* Центрування тексту для багаторядкових назв */
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.gallery-item:hover .card-img-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* 
============================================================
=== Стилі для кнопок дій (залишаються без змін) ===
============================================================
*/
.add-to-lab-btn,
.remove-from-lab-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease-in-out;
}

.gallery-item:hover .add-to-lab-btn,
.gallery-item:hover .remove-from-lab-btn {
    opacity: 1;
    transform: scale(1);
}

.add-to-lab-btn:hover {
    background-color: #E8BD2C;
    color: #000;
    border-color: transparent;
}

.remove-from-lab-btn:hover {
    background-color: #dc3545;
    color: #fff;
    border-color: transparent;
}

@media (max-width: 768px) {
.add-to-lab-btn,
.remove-from-lab-btn {
    opacity: 1;
    transform: scale(1);
}
}

.visibility-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 5px;
    margin-bottom: 0px;
}

.visibility-option {
    border: 1px solid #383838;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.visibility-option label {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0 15px;
    padding: 15px;
    cursor: pointer;
}

.visibility-option i.bi {
    grid-row: 1 / 3;
    font-size: 1.5rem;
    color: #888;
    transition: color 0.2s;
}

.visibility-option strong {
    font-weight: 500;
    color: #e0e0e0;
}

.visibility-option small {
    font-size: 0.85em;
    color: #888;
}

.visibility-option input[type="radio"] {
    margin-bottom: 0px;
    display: none;
}

.visibility-option:hover {
    border-color: #555;
}

.visibility-option input[type="radio"]:checked + label {
    border-color: #E8BD2C;
    background-color: rgba(232, 189, 44, 0.05);
}

.visibility-option input[type="radio"]:checked + label i.bi,
.visibility-option:hover i.bi {
    color: #E8BD2C;
}

/* Адаптивність для сітки */
@media (max-width: 768px) {
    .masonry-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    .page-title-container h1 {
        font-size: 1.5rem;
    }
    .btn-create-lab {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
    .lab-actions {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
}

/* ======================================================= */
/* === LAB SOCIAL FEATURES === */
/* ======================================================= */

/* Featured Badge */
.lab-featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #E8BD2C 0%, #d4a91e 100%);
    color: #000;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(232, 189, 44, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

.lab-featured-badge i {
    font-size: 0.85rem;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(232, 189, 44, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(232, 189, 44, 0.6);
    }
}

/* Fork Info */
.lab-fork-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-top: 15px;
}

.lab-fork-info i {
    color: #E8BD2C;
    font-size: 1rem;
}

.lab-fork-info a {
    color: #E8BD2C;
    text-decoration: none;
    transition: color 0.3s ease;
}

.lab-fork-info a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Tags Section */
.lab-tags-section {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.lab-tag {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(232, 189, 44, 0.15);
    border: 1px solid rgba(232, 189, 44, 0.3);
    border-radius: 15px;
    color: #E8BD2C;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.lab-tag:hover {
    background: rgba(232, 189, 44, 0.25);
    border-color: #E8BD2C;
    color: #fff;
    transform: translateY(-2px);
}

/* Social Section */
.lab-social-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Stats Row */
.lab-stats-row {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.lab-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.lab-stat-item i {
    color: #E8BD2C;
    font-size: 1rem;
}

.lab-stat-item strong {
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
}

.lab-stat-item span {
    color: rgba(255, 255, 255, 0.5);
}

/* Social Buttons */
.lab-social-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-lab-social {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-lab-social:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: translateY(-2px);
}

.btn-lab-social i {
    font-size: 0.95rem;
    transition: transform 0.3s ease;
}

/* Like Button */
.btn-lab-like.active {
    background: linear-gradient(135deg, #ff4757 0%, #ff6348 100%);
    border-color: #ff4757;
    color: #fff;
}

.btn-lab-like.active:hover {
    background: linear-gradient(135deg, #ff6348 0%, #ff4757 100%);
}

.btn-lab-like.active i {
    animation: heartBeat 0.5s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
}

/* Follow Button */
.btn-lab-follow.active {
    background: linear-gradient(135deg, #E8BD2C 0%, #d4a91e 100%);
    border-color: #E8BD2C;
    color: #000;
    font-weight: 600;
}

.btn-lab-follow.active:hover {
    background: linear-gradient(135deg, #d4a91e 0%, #E8BD2C 100%);
}

/* Fork Button */
.btn-lab-fork {
    background: rgba(76, 175, 80, 0.15);
    border-color: rgba(76, 175, 80, 0.3);
    color: #4CAF50;
}

.btn-lab-fork:hover {
    background: rgba(76, 175, 80, 0.25);
    border-color: #4CAF50;
    color: #fff;
}

/* Loading State */
.btn-lab-social.loading {
    pointer-events: none;
    opacity: 0.6;
}

.btn-lab-social.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .lab-stats-row {
        gap: 15px;
    }

    .lab-stat-item {
        font-size: 0.85rem;
    }

    .lab-social-buttons {
        width: 100%;
    }

    .btn-lab-social {
        flex: 1;
        justify-content: center;
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .lab-tags-section {
        gap: 6px;
    }

    .lab-tag {
        padding: 5px 12px;
        font-size: 0.8rem;
    }
}

/* ======================================================= */
/* === STACKED AVATARS FOR COLLABORATIVE LABS === */
/* ======================================================= */

.lab-authors-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Avatar Stack */
.lab-authors-avatars {
    display: flex;
    align-items: center;
    position: relative;
}

.lab-authors-avatars a {
    display: block;
    position: relative;
    text-decoration: none;
}

.lab-authors-avatars a:not(:first-child) {
    margin-left: -12px;
}

.lab-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #1a1a1a;
    object-fit: cover;
    transition: transform 0.2s ease, border-color 0.2s ease;
    display: block;
}

.lab-authors-avatars a:hover {
    z-index: 100 !important;
}

.lab-authors-avatars a:hover .lab-author-avatar {
    transform: translateY(-4px) scale(1.1);
    border-color: #E8BD2C;
}

.lab-authors-more {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(232, 189, 44, 0.15);
    border: 3px solid #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #E8BD2C;
    margin-left: -12px;
    position: relative;
}

/* Author Names */
.lab-authors-names {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.4;
}

.lab-authors-names a {
    color: #E8BD2C;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.lab-authors-names a:hover {
    color: #fff;
    text-decoration: underline;
}

.lab-authors-names .owner-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .lab-authors-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .lab-author-avatar {
        width: 36px;
        height: 36px;
        border-width: 2px;
    }

    .lab-authors-more {
        width: 36px;
        height: 36px;
        border-width: 2px;
        font-size: 0.7rem;
    }

    .lab-authors-names {
        font-size: 0.9rem;
    }
}
