/* ==========================================================================
   LiveCam Catalog - Bulma CSS Custom Theme & Facade Player Styles
   ========================================================================== */

:root {
    --primary-color: #00d1b2;
    --live-red: #ff3860;
    --card-bg: #ffffff;
    --bg-page: #f8f9fa;
}

body {
    background-color: var(--bg-page);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
}

main {
    flex: 1;
}

/* Navbar */
.navbar-brand .title {
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

.live-indicator-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--live-red);
    border-radius: 50%;
    margin-right: 6px;
    animation: livePulse 1.8s infinite;
}

@keyframes livePulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 56, 96, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(255, 56, 96, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 56, 96, 0); }
}

/* Hero Section */
.hero.is-primary {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* Region Nav Tabs & Pills */
.region-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.chip-btn {
    font-size: 0.85rem;
    border-radius: 20px;
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Camera Card */
.camera-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #edf2f7;
    background: #fff;
}

.camera-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* YouTube Facade Player Container (Zero overhead before click) */
.video-facade {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    background-color: #0f172a;
    cursor: pointer;
}

.video-facade img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-facade:hover img {
    transform: scale(1.04);
}

.video-facade iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Overlays on Thumbnail */
.facade-overlay-live {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(229, 62, 62, 0.9);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    z-index: 2;
    pointer-events: none;
}

.facade-overlay-viewers {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 2;
    pointer-events: none;
}

/* Centered Red Play Button */
.facade-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 58px;
    height: 40px;
    background-color: rgba(255, 0, 0, 0.88);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
    z-index: 2;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.facade-play-btn::before {
    content: "";
    border-style: solid;
    border-width: 9px 0 9px 16px;
    border-color: transparent transparent transparent #ffffff;
    margin-left: 3px;
}

.video-facade:hover .facade-play-btn {
    background-color: #ff0000;
    transform: translate(-50%, -50%) scale(1.12);
}

/* Card Content Details */
.camera-card-content {
    padding: 12px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.camera-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #1a202c;
}

.camera-channel {
    font-size: 0.8rem;
    color: #718096;
    margin-top: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal Player */
.modal-content.video-modal-content {
    width: 90%;
    max-width: 960px;
}

.modal-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
}

.modal-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
