/* ===========================
   Editor Styles
   =========================== */

.tok-movie-gallery-controls {
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
}

.tok-movie-gallery-controls .components-base-control {
    margin-bottom: 10px;
}

.tok-movie-gallery-controls .components-base-control__help {
    color: #757575;
    font-size: 12px;
}

/* ===========================
   Gallery Grid (共通)
   =========================== */

.tok-movie-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.tok-movie-gallery-item {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.tok-movie-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===========================
   Editor Item Controls
   =========================== */

.tok-movie-gallery-item-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 5px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.7);
}

.tok-movie-gallery-item-controls button {
    flex: 1;
    min-height: 30px;
}

/* ===========================
   Frontend Play Icon
   =========================== */

.tok-movie-gallery-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #000;
    pointer-events: none;
    transition: all 0.3s ease;
}

.tok-movie-gallery-item:hover .tok-movie-gallery-play-icon {
    background: rgba(255, 255, 255, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.tok-movie-gallery-item:hover img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.tok-movie-gallery-item {
    cursor: pointer;
}

/* ===========================
   Modal Styles
   =========================== */

.tok-movie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tok-movie-modal.is-open {
    opacity: 1;
}

.tok-movie-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.tok-movie-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
    z-index: 1;
}

.tok-movie-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.2s ease;
}

.tok-movie-modal-close:hover {
    opacity: 0.7;
}

.tok-movie-modal-video {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.tok-movie-modal-video iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 768px) {
    .tok-movie-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .tok-movie-modal-content {
        width: 95%;
    }

    .tok-movie-modal-close {
        top: -35px;
        font-size: 28px;
    }

    .tok-movie-gallery-play-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .tok-movie-gallery-grid {
        grid-template-columns: 1fr;
    }
}
