/* 📁 backend/core/static/core/css/premises.css */

/* ── Regional Filter ── */
.premises-filter-container {
    background: #ffffff;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid #f3f4f6;
    margin-bottom: 40px;
}

.premises-filter-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
}

.premises-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.premises-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.premises-filter-btn:hover {
    color: #0027A6;
    border-color: #0027A6;
    background: rgba(0, 39, 166, 0.02);
}

.premises-filter-btn.active {
    color: #ffffff;
    background: #0027A6;
    border-color: #0027A6;
    box-shadow: 0 4px 12px rgba(0, 39, 166, 0.15);
}

.premises-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    background: #f3f4f6;
    color: #4b5563;
    transition: all 0.25s;
}

.premises-filter-btn.active .premises-filter-count {
    background: #ffffff;
    color: #0027A6;
}

/* ── Listing Section ── */
.premises-section-header {
    margin-bottom: 24px;
}

.premises-section-title {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
}

.premises-section-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

/* ── Premises Grid & Card ── */
.premises-grid {
    display: grid;
    grid-template-cols: 1fr;
    gap: 30px;
}

@media (min-width: 640px) {
    .premises-grid {
        grid-template-cols: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .premises-grid {
        grid-template-cols: repeat(3, 1fr);
    }
}

.premises-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
}

.premises-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.premises-card-img-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: #f3f4f6;
}

.premises-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s;
}

.premises-card:hover .premises-card-img {
    transform: scale(1.05);
}

.premises-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.premises-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
    margin-bottom: 16px;
    transition: color 0.2s;
}

.premises-card:hover .premises-card-title {
    color: #0027A6;
}

.premises-card-specs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    flex-grow: 1;
}

.premises-card-spec-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #4b5563;
}

.premises-card-spec-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #0027A6;
}

.premises-card-spec-text {
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.premises-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    background: transparent;
    border: 1px solid #1f2937;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.premises-card:hover .premises-card-btn {
    background: #00319D;
    color: #ffffff;
    border-color: #00319D;
}

/* ── Detailed Page ── */
.premises-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #4b5563;
    text-decoration: none;
    margin-bottom: 24px;
    transition: color 0.2s;
}

.premises-detail-back:hover {
    color: #0027A6;
}

.premises-detail-title {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    line-height: 1.3;
    margin-bottom: 12px;
}

.premises-detail-location {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.premises-detail-location-icon {
    width: 20px;
    height: 20px;
    color: #0027A6;
    flex-shrink: 0;
    margin-top: 2px;
}

.premises-detail-divider {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 24px 0;
}

.premises-detail-specs-table {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.premises-detail-spec-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 6px 0;
}

.premises-detail-spec-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(0, 39, 166, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.premises-detail-spec-icon-box svg {
    width: 22px;
    height: 22px;
    color: #0027A6;
}

.premises-detail-spec-content {
    display: flex;
    flex-direction: column;
}

.premises-detail-spec-label {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.premises-detail-spec-value {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin-top: 2px;
}

/* ── Gallery component ── */
.premises-gallery-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.premises-gallery-main {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #f3f4f6;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    cursor: pointer;
    height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 640px) {
    .premises-gallery-main {
        height: 340px;
    }
}

.premises-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease;
}

.premises-gallery-thumbs-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.premises-thumbs-arrow {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #0027A6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.premises-thumbs-arrow:hover {
    background: #0027A6;
    color: #ffffff;
}

.premises-gallery-thumbs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    padding: 4px 0;
    flex: 1;
    min-width: 0;
}

.premises-gallery-thumbs::-webkit-scrollbar {
    display: none; /* Safari/Chrome */
}

.premises-thumb {
    width: 90px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: #f3f4f6;
}

.premises-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.premises-thumb:hover {
    opacity: 0.8;
}

.premises-thumb.active {
    border-color: #0027A6;
    box-shadow: 0 0 0 2px rgba(0, 39, 166, 0.2);
}

/* ── Plan & Map ── */
.premises-block-title {
    font-size: 20px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 20px;
}

.premises-plan-box {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.premises-plan-box img {
    max-width: 100%;
    height: auto;
    display: block;
}

.premises-map-box {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    height: 400px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.premises-map-frame {
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── Hero override for Premises pages: fixed-height band, full-width image ── */
.premises-hero-wrapper .hero-section {
    height: 400px !important;
    min-height: 400px !important;
    max-height: 400px !important;
    margin-top: 0 !important;
}

/* Full-width background image covering the fixed band */
.premises-hero-wrapper .hero-section img.premises-hero-img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
}

.premises-hero-wrapper .hero-container {
    height: 400px !important;
    min-height: 400px !important;
    max-height: 400px !important;
    padding-top: 140px !important;
}

@media (max-width: 640px) {
    .premises-hero-wrapper .hero-section {
        height: 250px !important;
        min-height: 250px !important;
        max-height: 250px !important;
    }
    .premises-hero-wrapper .hero-container {
        height: 250px !important;
        min-height: 250px !important;
        max-height: 250px !important;
        padding-top: 90px !important;
    }
}

/* ── Lightbox Modal ── */
.premises-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 130px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .premises-lightbox {
        padding-top: 90px;
    }
}

.premises-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.premises-lightbox-content {
    position: relative;
    z-index: 1;
    width: 70vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

@media (max-width: 768px) {
    .premises-lightbox-content {
        width: 95vw;
    }
}

.premises-lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.premises-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 2;
}

.premises-lightbox-close:hover {
    opacity: 1;
}

.premises-lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
}

.premises-lightbox-arrow:hover {
    background: rgba(255, 255, 255, 0.3);
}

.premises-lightbox-prev {
    left: -70px;
}

.premises-lightbox-next {
    right: -70px;
}

@media (max-width: 768px) {
    .premises-lightbox-prev { left: 8px; }
    .premises-lightbox-next { right: 8px; }
}

.premises-lightbox-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    max-width: 100%;
    padding: 4px;
    scrollbar-width: none;
}

.premises-lightbox-thumbs::-webkit-scrollbar {
    display: none;
}

.premises-lightbox-thumb {
    width: 64px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: all 0.2s;
    opacity: 0.5;
}

.premises-lightbox-thumb:hover {
    opacity: 0.8;
}

.premises-lightbox-thumb.active {
    border-color: #fff;
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.premises-lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
