/**
 * Frontend styles for Referenciák & Portfólió Kártyák
 */

.referenciak-container {
    width: 100%;
    box-sizing: border-box;
    margin: 20px 0;
}

.referenciak-container * {
    box-sizing: border-box;
}

/* Category Filter Bar */
.ref-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 35px;
}

.ref-filter-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    padding: 10px 24px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    user-select: none;
}

.ref-filter-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.ref-filter-btn.active {
    background: var(--ref-filter-active-bg, #000000);
    color: var(--ref-filter-active-color, #ffffff);
    border-color: var(--ref-filter-active-bg, #000000);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Cards Grid */
.ref-cards-grid {
    display: grid;
    grid-template-columns: repeat(var(--ref-cols-desktop, 3), 1fr);
    gap: 30px;
    align-items: stretch;
}

@media screen and (max-width: 1024px) {
    .ref-cards-grid {
        grid-template-columns: repeat(var(--ref-cols-tablet, 2), 1fr);
        gap: 24px;
    }
}

@media screen and (max-width: 680px) {
    .ref-cards-grid {
        grid-template-columns: repeat(var(--ref-cols-mobile, 1), 1fr);
        gap: 20px;
    }
}

/* Reference Card Item */
.ref-card-item {
    background-color: var(--ref-card-bg, #ffffff);
    border: 1px solid var(--ref-card-border, #edf2f7);
    border-radius: var(--ref-card-radius, 20px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    position: relative;
}

.ref-card-item:hover {
    transform: translateY(-6px);
    border-color: #cbd5e1;
    box-shadow: 0 20px 30px -10px rgba(15, 23, 42, 0.08), 0 10px 15px -3px rgba(15, 23, 42, 0.04);
}

/* Filtering animation */
.ref-card-item.is-hidden {
    display: none !important;
}

/* Media / Image Area */
.ref-card-media-wrap {
    height: 220px;
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: #081730;
}

.ref-card-bg-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.ref-card-item:hover .ref-card-bg-img {
    transform: scale(1.06);
}

/* Image Hover Overlay */
.ref-card-img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 23, 48, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ref-card-item:hover .ref-card-img-overlay {
    opacity: 1;
}

.ref-hover-view-badge {
    background: #ffffff;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(8px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ref-card-item:hover .ref-hover-view-badge {
    transform: translateY(0);
}

/* Fallback Icon Box */
.ref-card-icon-center {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #081730;
    transition: transform 0.3s ease;
}

.ref-card-item:hover .ref-card-icon-center {
    background: #0d2247;
}

.ref-card-lucide-icon,
.ref-card-icon-center svg {
    width: 44px;
    height: 44px;
    stroke: #facc15;
    color: #facc15;
    stroke-width: 2.2;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ref-card-item:hover .ref-card-lucide-icon,
.ref-card-item:hover .ref-card-icon-center svg {
    transform: scale(1.1);
}

/* Category Badge */
.ref-category-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background-color: var(--ref-badge-bg, #facc15);
    color: var(--ref-badge-color, #000000);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 5px 14px;
    border-radius: 9999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

/* Content Area */
.ref-card-content {
    padding: 24px 26px 28px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ref-card-title {
    font-size: 18px;
    line-height: 1.35;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 18px 0;
    transition: color 0.2s ease;
}

.ref-card-item:hover .ref-card-title {
    color: #2563eb;
}

/* Parameter Pills */
.ref-card-pills-wrap {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ref-pill-item {
    background-color: var(--ref-pill-bg, #f1f5f9);
    color: var(--ref-pill-color, #64748b);
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 9999px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    white-space: nowrap;
}

/* Empty State */
.ref-no-items {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #64748b;
    font-size: 15px;
}

/* =========================================
   LIGHTBOX MODAL & GALLERY POPUP
   ========================================= */

.ref-lightbox-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: refFadeIn 0.25s ease-out;
}

@keyframes refFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ref-lightbox-modal-container {
    background: #ffffff;
    width: 100%;
    max-width: 1060px;
    max-height: 90vh;
    border-radius: 24px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    animation: refSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes refSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ref-lightbox-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ref-lightbox-close-btn:hover {
    background: #e2e8f0;
    transform: scale(1.1);
}

/* Modal Inner */
.ref-modal-inner-content {
    padding: 36px;
    min-height: 300px;
}

@media screen and (max-width: 768px) {
    .ref-modal-inner-content {
        padding: 24px 20px;
    }
}

/* Loader */
.ref-modal-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 0;
    color: #64748b;
    font-size: 15px;
    font-weight: 600;
}

.ref-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: refSpin 0.8s linear infinite;
}

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

/* Layout: 2 Columns */
.ref-modal-data-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 36px;
}

@media screen and (max-width: 860px) {
    .ref-modal-data-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

/* Gallery Column */
.ref-modal-gallery-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ref-gallery-main-view {
    position: relative;
    background: #0f172a;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16 / 11;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ref-gallery-img-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ref-main-gallery-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
    transition: opacity 0.2s ease;
}

.ref-gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #0f172a;
    font-size: 26px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    z-index: 5;
}

.ref-gallery-nav-btn:hover {
    background: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

.ref-prev-btn { left: 14px; }
.ref-next-btn { right: 14px; }

.ref-gallery-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 9999px;
}

/* Thumbs Strip */
.ref-gallery-thumbs-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.ref-gallery-thumbs-strip::-webkit-scrollbar {
    height: 6px;
}

.ref-gallery-thumbs-strip::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.ref-thumb-item {
    width: 72px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.ref-thumb-item:hover {
    opacity: 0.9;
}

.ref-thumb-item.active {
    border-color: #2563eb;
    opacity: 1;
}

.ref-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Info Column */
.ref-modal-info-col {
    display: flex;
    flex-direction: column;
}

.ref-modal-header-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ref-modal-cat-badge {
    background: #facc15;
    color: #000000;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    border-radius: 9999px;
}

.ref-modal-year {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.ref-modal-title {
    font-size: 24px;
    line-height: 1.3;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 16px 0;
}

.ref-modal-pills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}

.ref-modal-desc-body {
    font-size: 15px;
    line-height: 1.7;
    color: #475569;
    margin-bottom: 24px;
}

.ref-modal-desc-body p {
    margin: 0 0 12px 0;
}

.ref-modal-extra-info {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13.5px;
    color: #64748b;
}
