/* -------------------------------------------------------------
 * Gillette Video Modal Block Styling
 * ------------------------------------------------------------- */

:root {
    --gvm-brand-blue: #0d2f55;
    --gvm-brand-gold: #c5a880;
    --gvm-white: #ffffff;
    --gvm-overlay-bg: rgba(13, 47, 85, 0.4);
    --gvm-modal-backdrop: rgba(10, 15, 30, 0.85);
    --gvm-transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

/* -------------------------------------------------------------
 * Frontend Trigger: Thumbnail Card Style
 * ------------------------------------------------------------- */
.gillette-video-modal-wrapper {
    margin: 0px 0;
    width: 100%;
}

.gvm-trigger-thumbnail {
    position: relative;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f1f1f1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--gvm-transition);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Aspect Ratios */
.gvm-aspect-16-9 {
    aspect-ratio: 16 / 9;
}

.gvm-aspect-4-3 {
    aspect-ratio: 4 / 3;
}

.gvm-aspect-1-1 {
    aspect-ratio: 1 / 1;
}

/* Thumbnail Overlay & Hover Effects */
.gvm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(13, 47, 85, 0.1) 0%, rgba(13, 47, 85, 0.6) 100%);
    transition: var(--gvm-transition);
    z-index: 1;
}

.gvm-play-btn-glow {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(197, 168, 128, 0.4);
    filter: blur(15px);
    opacity: 0;
    transform: scale(0.8);
    transition: var(--gvm-transition);
    z-index: 2;
}

.gvm-play-button {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--gvm-white);
    color: var(--gvm-brand-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(13, 47, 85, 0.25);
    z-index: 3;
    transition: var(--gvm-transition);
}

.gvm-play-button svg {
    margin-left: 4px;
    /* Align play icon visually to center */
    transition: var(--gvm-transition);
}

.gvm-thumbnail-title {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    color: var(--gvm-white);
    font-family: var(--global-heading-font-family, "Montserrat"), sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 3;
    transition: var(--gvm-transition);
}

/* Hover States for Thumbnail */
.gvm-trigger-thumbnail:hover {
    box-shadow: 0 15px 40px rgba(13, 47, 85, 0.15);
}

.gvm-trigger-thumbnail:hover .gvm-overlay {
    background: linear-gradient(180deg, rgba(13, 47, 85, 0.2) 0%, rgba(13, 47, 85, 0.75) 100%);
}

.gvm-trigger-thumbnail:hover .gvm-play-btn-glow {
    opacity: 1;
    transform: scale(1.1);
}

.gvm-trigger-thumbnail:hover .gvm-play-button {
    background: var(--gvm-brand-gold);
    color: var(--gvm-white);
    box-shadow: 0 10px 30px rgba(197, 168, 128, 0.4);
    transform: scale(1.08);
}

.gvm-trigger-thumbnail:hover .gvm-thumbnail-title {
    transform: translateY(-2px);
    color: var(--gvm-brand-gold);
}

/* Focus outline for accessibility */
.gvm-trigger-thumbnail:focus-visible {
    outline: 3px solid var(--gvm-brand-gold);
    outline-offset: 3px;
}

/* -------------------------------------------------------------
 * Frontend Trigger: Elegant Button Style
 * ------------------------------------------------------------- */
.gvm-trigger-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--gvm-brand-blue);
    color: var(--gvm-white);
    border: none;
    border-radius: 50px;
    padding: 14px 28px;
    font-family: var(--global-heading-font-family, "Montserrat"), sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(13, 47, 85, 0.15);
    transition: var(--gvm-transition);
}

.gvm-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    transition: var(--gvm-transition);
}

.gvm-btn-icon svg {
    margin-left: 2px;
}

/* Button Hover States */
.gvm-trigger-button:hover {
    background-color: var(--gvm-brand-gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(197, 168, 128, 0.3);
}

.gvm-trigger-button:hover .gvm-btn-icon {
    background-color: var(--gvm-white);
    color: var(--gvm-brand-blue);
}

.gvm-trigger-button:focus-visible {
    outline: 3px solid var(--gvm-brand-gold);
    outline-offset: 2px;
}

/* -------------------------------------------------------------
 * Premium Modal Overlay & Player
 * ------------------------------------------------------------- */
.gvm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--gvm-modal-backdrop);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease, backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease;
}

/* Active State */
.gvm-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Clickable close zone behind modal content */
.gvm-modal-close-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: zoom-out;
}

/* Modal Content Box */
.gvm-modal-container {
    position: relative;
    width: 90%;
    max-width: 960px;
    background-color: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    transform: scale(0.92) translateY(10px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Scale up when active */
.gvm-modal-overlay.active .gvm-modal-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Responsive aspect container for Video */
.gvm-video-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    display: flex;
    align-items: center;
}

.gvm-video-element {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* Floating Close Button */
.gvm-modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--gvm-white);
    font-size: 24px;
    line-height: 1;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--gvm-transition);
    z-index: 20;
    padding: 0;
}

.gvm-modal-close-btn:hover {
    background-color: var(--gvm-brand-gold);
    color: var(--gvm-white);
    border-color: var(--gvm-brand-gold);
    transform: rotate(90deg);
}

/* -------------------------------------------------------------
 * Gutenberg Block Editor Specific Styling
 * ------------------------------------------------------------- */
.gillette-video-modal-editor-container {
    box-sizing: border-box;
}

.gvm-editor-thumbnail {
    position: relative;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccd0d4;
    max-width: 600px;
    margin: 0 auto;
}

.gvm-editor-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(13, 47, 85, 0.05) 0%, rgba(13, 47, 85, 0.4) 100%);
    z-index: 1;
}

.gvm-editor-play-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gvm-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.gvm-editor-play-button svg {
    margin-left: 2px;
}

.gvm-editor-thumbnail-title {
    position: absolute;
    bottom: 12px;
    left: 15px;
    right: 15px;
    color: var(--gvm-white);
    font-family: "Montserrat", sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    z-index: 2;
    text-align: left;
}

.gvm-editor-trigger-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--gvm-brand-blue);
    color: var(--gvm-white);
    border: none;
    border-radius: 50px;
    padding: 10px 20px;
    font-family: "Montserrat", sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    pointer-events: none;
}

.gvm-editor-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
}

.gvm-editor-btn-icon svg {
    margin-left: 1px;
}

.gillette-video-modal-placeholder {
    padding: 15px;
    border: 1px dashed #d94f4f;
    color: #d94f4f;
    background-color: #fff8f8;
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
}

/* -------------------------------------------------------------
 * Preview Video & Thumbnail Background
 * ------------------------------------------------------------- */
.gvm-preview-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
    /* Make sure it doesn't block click events on the trigger card */
}

/* Pause control for the looping preview (WCAG 2.2.2) */
.gvm-has-preview-toggle {
    position: relative;
}

.gvm-preview-toggle {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 5;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid var(--gvm-white);
    background: var(--gvm-brand-blue);
    color: var(--gvm-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.gvm-preview-toggle:hover {
    background: #16467c;
}

.gvm-preview-toggle:focus-visible {
    outline: 3px solid var(--gvm-brand-gold);
    outline-offset: 3px;
}

/* Link to the text version of the video (WCAG 1.2.3) */
.gillette-video-modal-wrapper:has(.gvm-transcript-link) {
    position: relative;
}

.gvm-transcript-link {
    position: absolute;
    right: 72px;
    bottom: 20px;
    z-index: 5;
    padding: 8px 16px;
    border-radius: 50px;
    background: var(--gvm-brand-blue);
    border: 2px solid var(--gvm-white);
    color: var(--gvm-white) !important;
    font-family: var(--global-body-font-family, "Montserrat"), sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
}

.gvm-transcript-link:hover {
    background: #16467c;
}

.gvm-transcript-link:focus-visible {
    outline: 3px solid var(--gvm-brand-gold);
    outline-offset: 3px;
}

.gillette-video-modal-wrapper:not(.gvm-has-preview-toggle) .gvm-transcript-link {
    right: 16px;
}

/* Phones: a smaller play button keeps the corner controls clear of it. */
@media (max-width: 600px) {
    .gvm-play-button {
        width: 80px !important;
        height: 80px !important;
    }
    .gvm-play-button svg {
        width: 34px;
        height: 34px;
        margin-left: 4px !important;
    }
    .gvm-play-btn-glow {
        width: 90px !important;
        height: 90px !important;
    }
}

.gvm-thumbnail-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
}