/* Home page - standalone, no base.html. Full-width layout, no sidebar. */

/* Reset: ensure no dashboard/sidebar layout bleeds in */
.home-body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    min-height: 100vh;
    background: var(--color-bg-subtle);
    color: var(--color-text);
    overflow-x: hidden;
    display: block;
}

.home-body .home-header,
.home-body .home-main {
    margin-left: 0 !important;
}

/* ===== HEADER – Bharatgas style: bright yellow top, logos left/right, title center ===== */
.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px 22px;
    background: linear-gradient(180deg, #FFD700 0%, #FFE44D 50%, #FFEE7A 100%);
    width: 100%;
    border-bottom: 3px solid #003366;
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.15);
}

.home-header-left,
.home-header-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    min-width: 0;
}

.home-header-left {
    justify-content: flex-start;
}

.home-header-right {
    justify-content: flex-end;
}

.home-header-center {
    flex: 1 1 auto;
    text-align: center;
    padding: 0 24px;
    min-width: 0;
}

.home-logo {
    height: 72px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    display: block;
}

.home-logo-left {
    max-width: 180px;
}

.home-logo-circle {
    width: 72px;
    height: 72px;
    max-width: none;
    border-radius: 50%;
    object-fit: cover;
}

.home-heading {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 6px 0;
    letter-spacing: 0.04em;
    color: #003366;
    text-transform: uppercase;
    line-height: 1.2;
}

.home-subheading {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.06em;
    color: #003366;
    text-transform: uppercase;
    line-height: 1.3;
    opacity: 0.9;
}

@media (max-width: 900px) {
    .home-header {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
        padding: 16px 20px 18px;
    }
    .home-header-left {
        order: 1;
        flex: 0 0 auto;
    }
    .home-header-center {
        order: 3;
        flex: 1 1 100%;
        padding: 0;
    }
    .home-header-right {
        order: 2;
        flex: 0 0 auto;
    }
    .home-heading {
        font-size: 22px;
    }
    .home-subheading {
        font-size: 13px;
    }
    .home-logo {
        height: 56px;
        max-width: 140px;
    }
    .home-logo-circle {
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 600px) {
    .home-header {
        flex-direction: column;
        gap: 12px;
    }
    .home-header-left,
    .home-header-right {
        justify-content: center;
    }
    .home-heading {
        font-size: 20px;
    }
    .home-subheading {
        font-size: 12px;
    }
    .home-logo {
        height: 48px;
    }
    .home-logo-circle {
        width: 48px;
        height: 48px;
    }
}

/* ===== MAIN – 10px margin and padding on all sides ===== */
.home-main {
    margin: 10px;
    padding: 10px;
    max-width: none;
    min-height: calc(100vh - 140px);
    position: relative;
    box-sizing: border-box;
}

/* Permit carousel: one slide at a time, full width */
.home-permit-section {
    display: none;
    flex-direction: column;
    width: 100%;
    min-height: calc(100vh - 120px);
    animation: homeFadeIn 0.5s ease;
}

.home-permit-section.active {
    display: flex;
}

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

/* Work type background colors – Bharatgas palette (full-bleed) */
.home-permit-section.work-type-hot {
    background-color: #ffede8;
}

.home-permit-section.work-type-cold {
    background-color: #e8f4fc;
}

.home-permit-section.work-type-electrical {
    background-color: #FFFDE7;
}

.home-permit-section.work-type-none {
    background-color: #FFFDE7;
}

.home-no-permits {
    background-color: #FFFDE7;
}

/* Permit info strip – full width with inner padding */
.home-permit-info {
    flex-shrink: 0;
    padding: 24px 32px 20px;
    width: 100%;
    box-sizing: border-box;
}

.home-permit-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.home-permit-desc {
    font-size: 16px;
    color: var(--color-text);
    margin: 0 0 14px 0;
    line-height: 1.5;
}

.home-permit-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 0;
}

.home-permit-meta-item {
    font-size: 14px;
    color: var(--color-text-muted);
}

.home-permit-meta-item i {
    margin-right: 6px;
    color: var(--color-primary);
}

.home-permit-meta-item.work-type-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.home-permit-meta-item.work-type-hot {
    background-color: #ffc4b2;
    color: #c2410c;
}

.home-permit-meta-item.work-type-cold {
    background-color: #b3d9f2;
    color: #003366;
}

.home-permit-meta-item.work-type-electrical {
    background-color: #FFE44D;
    color: #8B6914;
}

/* ===== PHOTO CAROUSEL – full width, no side margin ===== */
.home-photo-carousel-wrap {
    flex: 1;
    min-height: 0;
    width: 100%;
    padding: 0 0 20px 0;
    box-sizing: border-box;
}

.home-photo-carousel-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 32px 8px;
}

.home-photo-carousel {
    width: 100%;
    min-height: 360px;
    overflow: hidden;
    background: #003366;
    box-sizing: border-box;
    border-radius: 12px;
}

.home-carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 360px;
}

.home-carousel-slide {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: #003366;
}

.home-carousel-slide.active {
    display: flex;
    z-index: 1;
    animation: homeFadeIn 0.6s ease;
}

.home-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

/* Photo carousel dots – hidden */
.home-carousel-dots {
    display: none !important;
}

.home-carousel-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    color: var(--color-text-light);
    font-size: 15px;
}

/* Permit progress dots – hidden (carousel index not displayed) */
.home-permit-dots {
    display: none !important;
}

@media (max-width: 600px) {
    .home-permit-info {
        padding: 20px 20px 16px;
    }
    .home-permit-number {
        font-size: 22px;
    }
    .home-photo-carousel-label {
        margin-left: 20px;
        margin-right: 20px;
    }
    .home-photo-carousel,
    .home-carousel-track {
        min-height: 280px;
    }
    .home-carousel-empty {
        min-height: 280px;
    }
    .home-permit-dots {
        bottom: 16px;
    }
}

/* ===== BOTTOM IMAGE – full width of page, Video View button top-right ===== */
.home-bottom-image-wrap {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    display: block;
}

.home-video-view-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(30, 41, 59, 0.2);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.home-video-view-btn:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.home-video-view-btn:focus {
    outline: 2px solid var(--color-primary, #003366);
    outline-offset: 2px;
}

.home-bottom-image {
    width: 100%;
    margin: 0;
    padding: 0;
    display: block;
    overflow: hidden;
}

.home-bottom-image img {
    width: 100%;
    display: block;
    height: auto;
    vertical-align: middle;
}

/* ===== Video View modal popup ===== */
.home-video-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s, opacity 0.2s;
}

.home-video-modal.is-open {
    visibility: visible;
    opacity: 1;
}

.home-video-modal.is-open .home-video-modal-content {
    transform: scale(1);
}

.home-video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 51, 102, 0.5);
    cursor: pointer;
}

.home-video-modal-content {
    position: relative;
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.home-video-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.home-video-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.home-video-modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.home-video-modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.home-video-modal-body {
    padding: 20px;
    overflow: auto;
    min-height: 0;
}

/* Video grid – cards like screenshot */
.home-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.home-video-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.home-video-card-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #003366;
    overflow: hidden;
}

.home-video-card-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

/* Show video first frame as thumbnail (poster) – no blank screen */
.home-video-card-video.is-poster {
    display: block;
    object-fit: cover;
}

.home-video-card-video.is-playing {
    display: block;
    object-fit: contain;
}

.home-video-card-thumb-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #002244;
    pointer-events: none;
}

.home-video-card-thumb-placeholder .home-video-card-loading-text {
    font-size: 13px;
    color: #94a3b8;
}

.home-video-card-thumb-placeholder.is-hidden {
    display: none;
}

.home-video-card-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    color: #1e293b;
    font-size: 22px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    z-index: 2;
}

.home-video-card-play-overlay i {
    margin-left: 4px;
}

.home-video-card-play-overlay:hover {
    background: #fff;
    transform: translate(-50%, -50%) scale(1.08);
}

.home-video-card-play-overlay.is-hidden {
    display: none;
}

/* Dark grey control bar – like screenshot */
.home-video-card-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #003366;
    border-radius: 0 0 6px 6px;
    min-height: 40px;
}

.home-video-card-btn-play,
.home-video-card-btn-fullscreen {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.home-video-card-btn-play:hover,
.home-video-card-btn-fullscreen:hover {
    background: rgba(255, 255, 255, 0.15);
}

.home-video-card-time {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.home-video-card-filename {
    margin: 8px 12px 0;
    font-size: 13px;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.home-video-card-filesize {
    margin: 2px 12px 12px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.3;
}

.home-video-empty {
    margin: 0;
    padding: 24px;
    text-align: center;
    font-size: 15px;
    color: #64748b;
}
