/**
 * Glass Theme Styles
 *
 * Liquid glass effect calendar theme
 * Architecture: blur-layer -> events-layer -> reflection-layer -> content-layer
 *
 * @package Modern_Year
 */

/* ============================================
   CSS Variables (defaults, overridden by PHP)
   ============================================ */
.my-theme-glass {
    --my-glass-gap: 8px;
    --my-glass-radius: 24px;
    --my-glass-blur: 20px;
    --my-glass-tint: rgba(255, 255, 255, 0.25);
    --my-glass-shine: 1;  /* Full intensity by default */
    --my-glass-header-color: #6B7280;
    --my-glass-daynames-bg: rgba(255, 255, 255, 0.4);
    --my-glass-cell-size: 120px;
    /* Controls defaults (overridden by PHP) */
    --my-controls-bg: rgba(255, 255, 255, 0.25);
    --my-controls-text: #6B7280;
    --my-controls-border: rgba(255, 255, 255, 0.4);
    /* Day number defaults (overridden by PHP) */
    --my-dn-regular-bg: transparent;
    --my-dn-regular-text: rgba(0, 0, 0, 0.65);
    --my-dn-regular-radius: 4px;
    --my-dn-regular-img-bg: rgba(255, 255, 255, 0.9);
    --my-dn-regular-img-text: #1F2937;
    --my-dn-regular-img-radius: 4px;
    --my-dn-today-bg: #3B82F6;
    --my-dn-today-text: #FFFFFF;
    --my-dn-today-radius: 50%;
    --my-dn-today-img-bg: #3B82F6;
    --my-dn-today-img-text: #FFFFFF;
    --my-dn-today-img-radius: 50%;
}

/* ============================================
   Main Calendar Container
   ============================================ */
.my-glass-calendar {
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   Header with Navigation
   ============================================ */
.my-glass-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 8px;
    margin-bottom: 8px;
}

.my-glass-header-left,
.my-glass-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.my-glass-title {
    font-size: 1.5rem;
    font-weight: 600;
    font-family: var(--my-glass-title-font, inherit) !important;
    text-transform: var(--my-glass-title-transform, none) !important;
    color: var(--my-glass-header-color);
    margin: 0;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

/* Date navigation dropdowns */
.my-glass-date-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.my-glass-month-select,
.my-glass-year-select {
    padding: 8px 32px 8px 14px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--my-controls-text);
    background: var(--my-controls-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--my-controls-border);
    border-radius: calc(var(--my-glass-radius) * 0.5);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    box-shadow:
        inset 1px 1px 4px rgba(255, 255, 255, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.my-glass-month-select:hover,
.my-glass-year-select:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.my-glass-month-select:focus,
.my-glass-year-select:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow:
        inset 1px 1px 4px rgba(255, 255, 255, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 0 3px rgba(59, 130, 246, 0.2);
}

.my-glass-month-select:active,
.my-glass-year-select:active {
    filter: brightness(0.95);
}

/* Dropdown option styling */
.my-glass-month-select option,
.my-glass-year-select option {
    background-color: rgba(255, 255, 255, 0.95);
    color: var(--my-controls-text);
    padding: 8px;
}

.my-glass-year-select {
    padding-right: 28px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.my-glass-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--my-controls-border);
    border-radius: 50%;
    background: var(--my-controls-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--my-controls-text);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        inset 1px 1px 3px rgba(255, 255, 255, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.my-glass-nav:hover {
    background: var(--my-controls-bg);
    filter: brightness(1.1);
    transform: scale(1.05);
}

.my-glass-nav:active {
    transform: scale(0.95);
}

.my-glass-nav svg {
    width: 26px;
    height: 26px;
}

/* Active state for dropdown buttons */
.my-glass-nav.active {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
}

/* ============================================
   Dropdown Panels
   ============================================ */
.my-glass-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 8px;
    z-index: 100;
    min-width: 200px;
    background: var(--my-glass-tint);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--my-glass-radius);
    box-shadow:
        inset 2px 2px 8px rgba(255, 255, 255, 0.4),
        0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    pointer-events: none;
}

.my-glass-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.my-glass-dropdown-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.my-glass-dropdown-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.my-glass-dropdown-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.my-glass-dropdown-select {
    width: 100%;
    padding: 10px 32px 10px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: calc(var(--my-glass-radius) * 0.4);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.2s ease;
}

.my-glass-dropdown-select:hover {
    background-color: rgba(255, 255, 255, 0.7);
}

.my-glass-dropdown-select:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.my-glass-dropdown-select option {
    background: white;
    color: #333;
}

/* Single filter mode - inline select in header */
.my-glass-inline-filter {
    height: 48px;
    padding: 0 30px 0 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--my-controls-text);
    background-color: var(--my-controls-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--my-controls-border);
    border-radius: 24px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    box-shadow:
        inset 1px 1px 3px rgba(255, 255, 255, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.my-glass-inline-filter:hover {
    background-color: var(--my-controls-bg);
    filter: brightness(1.1);
    transform: scale(1.05);
}

.my-glass-inline-filter:active {
    transform: scale(0.95);
}

.my-glass-inline-filter:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow:
        inset 1px 1px 3px rgba(255, 255, 255, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 0 3px rgba(59, 130, 246, 0.2);
}

.my-glass-inline-filter option {
    background-color: rgba(255, 255, 255, 0.95);
    color: var(--my-controls-text);
}

/* ============================================
   Day Names Row
   ============================================ */
.my-glass-day-names {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--my-glass-gap);
    margin-bottom: var(--my-glass-gap);
    padding: 0 4px;
}

.my-glass-day-name {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--my-glass-header-color);
    padding: 8px 0;
}

/* Bubble style for day names */
.my-glass-day-names-bubbles .my-glass-day-name {
    background: var(--my-glass-daynames-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: calc(var(--my-glass-radius) * 0.5);
    box-shadow:
        inset 1px 1px 4px rgba(255, 255, 255, 0.3),
        0 2px 6px rgba(0, 0, 0, 0.08);
}

/* ============================================
   Calendar Grid Container
   ============================================ */
.my-glass-grid-container {
    position: relative;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--my-glass-gap);
    padding: 4px;
}

/* ============================================
   Layer 1: Blur Layer (background cells)
   ============================================ */
.my-glass-blur-layer {
    position: absolute;
    inset: 4px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--my-glass-gap);
    z-index: 0;
    pointer-events: none;
}

.my-glass-blur-cell {
    aspect-ratio: 1;
    border-radius: var(--my-glass-radius);
    overflow: hidden; /* Clip background-image to border-radius */
    /* Glass blur effect - blurs background behind (e.g. wavy waves) */
    background: var(--my-glass-tint);
    backdrop-filter: blur(var(--my-glass-blur));
    -webkit-backdrop-filter: blur(var(--my-glass-blur));
    /* Prevent sub-pixel rendering artifacts */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Other month cells - NO filter here, it breaks backdrop-filter */
/* Dimming is handled by reflection layer overlay */

/* Other month blur cells with images - add overlay to fade the image */
.my-glass-blur-cell.other-month {
    position: relative;
    overflow: hidden;
}

.my-glass-blur-cell.other-month::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    z-index: 1;
}

/* Cells with event images - keep blur on top of image */
.my-glass-blur-cell.has-image {
    /* Use light grey to fill any gaps between image and border-radius */
    background-color: #f5f5f5;
    /* Ensure image covers fully with no gaps */
    background-origin: border-box;
    /* Remove any potential outline/box-shadow artifacts */
    outline: none;
    box-shadow: none;
}

/* ============================================
   Layer 2: Events Layer (Multi-day bars)
   ============================================ */
.my-glass-events-layer {
    position: absolute;
    inset: 4px;
    z-index: 1;
    pointer-events: none;
}

.my-glass-event-bar {
    position: absolute;
    height: 26px;
    border-radius: 6px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    line-height: 26px;
    padding: 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: auto;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.2s ease;
    /* Mask will be applied dynamically via JavaScript */
}

.my-glass-event-bar:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Event bar rows (stacking) */
.my-glass-event-bar.row-0 {
    /* Calculated dynamically */
}

.my-glass-event-bar.row-1 {
    /* Calculated dynamically */
}

.my-glass-event-bar.row-2 {
    /* Calculated dynamically */
}

/* ============================================
   Layer 3: Reflection Layer
   ============================================ */
.my-glass-reflection-layer {
    position: absolute;
    inset: 4px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--my-glass-gap);
    z-index: 2;
    pointer-events: none;
}

.my-glass-reflection-cell {
    aspect-ratio: 1;
    border-radius: var(--my-glass-radius);
    position: relative;
    overflow: hidden;
    /* Glass reflection effect - enhanced */
    border: 2px solid rgba(255, 255, 255, calc(0.8 * var(--my-glass-shine)));
    box-shadow:
        inset 6px 6px 20px rgba(255, 255, 255, calc(1 * var(--my-glass-shine))),
        inset -3px -3px 15px rgba(0, 0, 0, calc(0.2 * var(--my-glass-shine))),
        inset 0 0 40px rgba(255, 255, 255, calc(0.3 * var(--my-glass-shine)));
    /* Combined gradient: top-left shine + center glow */
    background:
        /* Top-left shine */
        linear-gradient(
            145deg,
            rgba(255, 255, 255, calc(0.95 * var(--my-glass-shine))) 0%,
            rgba(255, 255, 255, calc(0.5 * var(--my-glass-shine))) 15%,
            rgba(255, 255, 255, calc(0.15 * var(--my-glass-shine))) 35%,
            transparent 50%
        ),
        /* Center radial glow */
        radial-gradient(
            ellipse 80% 60% at 50% 50%,
            rgba(255, 255, 255, calc(0.25 * var(--my-glass-shine))) 0%,
            rgba(255, 255, 255, calc(0.1 * var(--my-glass-shine))) 40%,
            transparent 70%
        ),
        /* Bottom-right subtle highlight */
        linear-gradient(
            -30deg,
            transparent 60%,
            rgba(255, 255, 255, calc(0.15 * var(--my-glass-shine))) 80%,
            rgba(255, 255, 255, calc(0.25 * var(--my-glass-shine))) 100%
        );
}

/* Add pseudo-element for additional center shine effect */
.my-glass-reflection-cell::before {
    content: '';
    position: absolute;
    top: 30%;
    left: 30%;
    width: 40%;
    height: 40%;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, calc(0.35 * var(--my-glass-shine))) 0%,
        rgba(255, 255, 255, calc(0.15 * var(--my-glass-shine))) 30%,
        transparent 70%
    );
    filter: blur(8px);
    pointer-events: none;
}

/* Other month cells - faded via white overlay (not filter, to preserve blur) */
.my-glass-reflection-cell.other-month::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

/* Image cells - remove dark inset shadow that creates visible dark border on photo cells.
   The dark component (rgba(0,0,0,...) at -3px -3px) is the "liquid depth" effect but
   becomes a visible dark frame when there's a photo underneath. Replace with white-only shadows. */
.my-glass-reflection-cell.has-image {
    box-shadow:
        inset 6px 6px 20px rgba(255, 255, 255, calc(1 * var(--my-glass-shine))),
        inset 0 0 40px rgba(255, 255, 255, calc(0.3 * var(--my-glass-shine)));
    border-color: rgba(255, 255, 255, calc(1 * var(--my-glass-shine)));
}

/* Other month image cells - extra white overlay to further fade the photo */
.my-glass-reflection-cell.other-month.has-image {
    box-shadow:
        inset 0 0 15px 8px rgba(255, 255, 255, 0.5),
        inset 6px 6px 20px rgba(255, 255, 255, calc(0.5 * var(--my-glass-shine))),
        inset 0 0 40px rgba(255, 255, 255, calc(0.15 * var(--my-glass-shine)));
    border-color: rgba(255, 255, 255, 1);
}

/* ============================================
   Layer 4: Content Layer
   ============================================ */
.my-glass-content-layer {
    /* display:contents makes children participate in parent grid */
    display: contents;
}

.my-glass-day-cell {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    z-index: 3;
    /* Allow clicks to pass through to event bars below */
    pointer-events: none;
    /* Prevent event pills from overflowing cell boundaries */
    overflow: hidden;
}

/* Day number - Regular (no image) */
.my-glass-day-number {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--my-dn-regular-text);
    background: var(--my-dn-regular-bg);
    border-radius: var(--my-dn-regular-radius);
    padding: 2px 6px;
    min-width: 20px;
    text-align: center;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
    z-index: 4;
}

/* Other month day number */
.my-glass-day-cell.other-month .my-glass-day-number {
    color: rgba(0, 0, 0, 0.3);
}

/* Other month single-day events — dimmed to match cell */
.my-glass-day-cell.other-month .my-glass-single-event {
    opacity: 0.4;
}

/* Today's day number (no image) */
.my-glass-day-cell.is-today .my-glass-day-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 4px;
    right: 6px;
    padding: 0;
    color: var(--my-dn-today-text);
    text-shadow: none;
    border-radius: var(--my-dn-today-radius);
    background: var(--my-dn-today-bg);
    box-shadow:
        inset 2px 2px 4px rgba(255, 255, 255, 0.4),
        inset -1px -1px 3px rgba(0, 0, 0, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Day number on image (regular day) */
.my-glass-day-cell.has-image .my-glass-day-number {
    color: var(--my-dn-regular-img-text);
    background: var(--my-dn-regular-img-bg);
    border-radius: var(--my-dn-regular-img-radius);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Today's day number on image */
.my-glass-day-cell.is-today.has-image .my-glass-day-number {
    color: var(--my-dn-today-img-text);
    background: var(--my-dn-today-img-bg);
    border-radius: var(--my-dn-today-img-radius);
}

/* Single-day events container */
.my-glass-day-events {
    position: absolute;
    top: 32px;
    left: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: auto;
}

/* Single-day event pill */
.my-glass-single-event {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.my-glass-single-event:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* "+N more" indicator */
.my-glass-more-events {
    font-size: 10px;
    color: rgba(0, 0, 0, 0.5);
    text-align: center;
    cursor: pointer;
}

.my-glass-more-events:hover {
    color: rgba(0, 0, 0, 0.8);
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 768px) {
    .my-theme-glass {
        --my-glass-gap: 4px;
        --my-glass-radius: 16px;
    }

    .my-glass-header {
        padding: 12px 4px;
        flex-wrap: wrap;
    }

    .my-glass-title {
        font-size: 1.2rem;
        order: -1;
        width: 100%;
        text-align: center;
        margin-bottom: 8px;
    }

    .my-glass-nav {
        width: 42px;
        height: 42px;
    }

    .my-glass-nav svg {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px;
        min-height: 22px;
    }

    .my-glass-day-name {
        font-size: 0.75rem;
        padding: 6px 0;
    }

    .my-glass-day-number {
        font-size: 14px;
        top: 4px;
        right: 6px;
    }

    .my-glass-day-cell.is-today .my-glass-day-number {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .my-glass-event-bar {
        height: 22px;
        font-size: 10px;
        line-height: 22px;
        padding: 0 6px;
    }

    .my-glass-single-event {
        font-size: 10px;
        padding: 3px 6px;
    }

    .my-glass-day-events {
        top: 28px;
        left: 4px;
        right: 4px;
    }
}

@media (max-width: 480px) {
    .my-theme-glass {
        --my-glass-gap: 2px;
        --my-glass-radius: 12px;
    }

    .my-glass-day-name {
        font-size: 0.65rem;
    }

    .my-glass-day-number {
        font-size: 12px;
    }

    /* Compact single-day events on very small screens */
    .my-glass-day-events {
        top: 22px;
        left: 2px;
        right: 2px;
        gap: 1px;
    }

    .my-glass-single-event {
        font-size: 7px;
        padding: 1px 3px;
        border-radius: 2px;
        line-height: 1.2;
    }

    .my-glass-nav {
        width: 36px;
        height: 36px;
    }

    .my-glass-nav svg {
        width: 20px !important;
        height: 20px !important;
        min-width: 20px;
        min-height: 20px;
    }
}

/* ============================================
   Loading State
   ============================================ */
.my-glass-calendar.loading .my-glass-blur-layer,
.my-glass-calendar.loading .my-glass-reflection-layer {
    animation: glass-pulse 1.5s ease-in-out infinite;
}

@keyframes glass-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* ============================================
   GLightbox integration
   ============================================ */
.my-glass-event-bar[data-event-id],
.my-glass-single-event[data-event-id] {
    cursor: pointer;
}

/* ============================================
   Hover Preview Tooltip
   ============================================ */
.my-glass-preview {
    position: fixed;
    z-index: 10000;
    width: 200px;
    height: 120px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--my-glass-tint, rgba(255, 255, 255, 0.25));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        inset 2px 2px 8px rgba(255, 255, 255, 0.5),
        0 8px 32px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.2s ease;
    pointer-events: none;
}

.my-glass-preview.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.my-glass-preview-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.my-glass-preview.has-image .my-glass-preview-content {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}

.my-glass-preview-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    z-index: 1;
}

.my-glass-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--my-glass-header-color, #374151);
    line-height: 1.3;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.my-glass-preview.has-image .my-glass-preview-title {
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.my-glass-preview-time {
    font-size: 12px;
    color: var(--my-glass-header-color, #6B7280);
    opacity: 0.8;
}

.my-glass-preview.has-image .my-glass-preview-time {
    color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   Lightbox Styles for Glass Theme
   ============================================ */
.goverlay {
    background: rgba(0, 0, 0, 0.7) !important;
}

.gslide-inline .ginlined-content {
    max-width: 400px !important;
    width: 90vw !important;
    max-height: 80vh !important;
    overflow: hidden !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4) !important;
}

.my-lb-content {
    background: #fff;
    border-radius: 20px;
    overflow: hidden !important;
    width: 100% !important;
    max-height: 80vh !important;
    display: flex;
    flex-direction: column;
}

.my-lb-image {
    width: 100% !important;
    height: 180px !important;
    min-height: 180px !important;
    overflow: hidden !important;
    display: block !important;
    flex-shrink: 0;
}

.my-lb-image img {
    width: 100% !important;
    height: 180px !important;
    object-fit: cover !important;
    display: block !important;
}

.my-lb-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.my-lb-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px;
    line-height: 1.3;
}

.my-lb-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.my-lb-meta > span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
}

.my-lb-meta svg {
    flex-shrink: 0;
    opacity: 0.8;
    color: #6b7280;
}

.my-lb-excerpt {
    color: #374151;
    margin: 0 0 20px;
    line-height: 1.6;
    font-size: 15px;
}

.my-lb-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff !important;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.my-lb-link:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* Lightbox bez obrázku */
.my-lb-content:not(:has(.my-lb-image)) .my-lb-body {
    padding-top: 28px;
}

/* Responsive lightbox */
@media (max-width: 480px) {
    .gslide-inline .ginlined-content {
        width: 95vw !important;
        max-height: 85vh !important;
    }

    .my-lb-image,
    .my-lb-image img {
        height: 140px !important;
        min-height: 140px !important;
    }

    .my-lb-body {
        padding: 20px;
    }

    .my-lb-title {
        font-size: 1.15rem;
    }

    .my-lb-link {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   Filter Styles for Glass Theme
   ============================================ */
.my-theme-glass .my-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 0 4px;
}

.my-theme-glass .my-filter-group {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
}

.my-theme-glass .my-filter-select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--my-controls-text);
    background: var(--my-controls-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--my-controls-border);
    border-radius: calc(var(--my-glass-radius) * 0.5);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    box-shadow:
        inset 1px 1px 4px rgba(255, 255, 255, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.my-theme-glass .my-filter-select:hover {
    transform: translateY(-1px);
    box-shadow:
        inset 1px 1px 4px rgba(255, 255, 255, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.12);
}

.my-theme-glass .my-filter-select:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    background-color: var(--my-glass-tint);
    box-shadow:
        inset 1px 1px 4px rgba(255, 255, 255, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 0 0 3px rgba(59, 130, 246, 0.2);
}

.my-theme-glass .my-filter-select option {
    background-color: rgba(255, 255, 255, 0.95);
    color: var(--my-controls-text);
    padding: 8px;
}

/* Responsive filters */
@media (max-width: 768px) {
    .my-theme-glass .my-filters {
        gap: 6px;
    }

    .my-theme-glass .my-filter-group {
        min-width: 120px;
    }

    .my-theme-glass .my-filter-select {
        padding: 8px 32px 8px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .my-theme-glass .my-filter-group {
        flex: 1 1 100%;
        max-width: none;
    }
}

/* ============================================
   Expand Popup (Moving Cards style)
   ============================================ */
.my-expand-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.my-expand-overlay.active {
    opacity: 1;
    visibility: visible;
}

.my-expand-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 9999;
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.my-expand-container.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.my-expand-card {
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.my-expand-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    font-size: 26px;
    line-height: 1;
    padding: 0;
    padding-bottom: 4px;
}

.my-expand-close:hover {
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.3);
    color: #fff;
}

.my-expand-image {
    width: 100%;
    height: 180px;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    flex-shrink: 0;
}

.my-expand-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0; /* Enable flex child scrolling */
}

.my-expand-type {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.my-expand-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px;
    line-height: 1.3;
}

.my-expand-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.my-expand-meta > span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
}

.my-expand-meta svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

.my-expand-excerpt {
    color: #374151;
    margin: 0 0 20px;
    line-height: 1.6;
    font-size: 15px;
}

.my-expand-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff !important;
    padding: 14px 28px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.my-expand-button:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.my-expand-button svg {
    width: 18px;
    height: 18px;
}

/* Responsive expand popup */
@media (max-width: 768px) {
    .my-expand-container {
        width: 96%;
        max-height: 94vh;
    }

    .my-expand-card {
        border-radius: 16px;
        max-height: 94vh;
    }

    .my-expand-image {
        height: 140px;
    }

    .my-expand-content {
        padding: 16px;
    }

    .my-expand-title {
        font-size: 1.15rem;
    }

    .my-expand-button {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   Standalone Location Filter (above calendar)
   ============================================ */
.my-glass-standalone-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--my-glass-tint, rgba(255, 255, 255, 0.25));
    backdrop-filter: blur(var(--my-glass-blur, 10px));
    -webkit-backdrop-filter: blur(var(--my-glass-blur, 10px));
    border-radius: var(--my-glass-radius, 16px);
    border: 1px solid rgba(255, 255, 255, calc(0.3 * var(--my-glass-shine, 1)));
}

.my-glass-pin-icon {
    flex-shrink: 0;
    color: var(--my-glass-header-color, #6B7280);
    opacity: 0.8;
}

.my-glass-standalone-select {
    flex: 1;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--my-glass-header-color, #374151);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: calc(var(--my-glass-radius, 16px) / 2);
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.my-glass-standalone-select:hover {
    background: rgba(255, 255, 255, 0.7);
}

.my-glass-standalone-select:focus {
    outline: none;
    border-color: var(--my-glass-header-color, #6B7280);
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.2);
}

@media (max-width: 480px) {
    .my-glass-standalone-filter {
        padding: 10px 12px;
    }

    .my-glass-standalone-select {
        font-size: 13px;
        padding: 6px 10px;
        padding-right: 30px;
    }
}
