/**
 * Public Stylesheet for Święta na Starówce Plugin
 * Only essential SVG map element styling
 *
 * @since      1.0.0
 * @package    Swieta_Na_Starowce
 * @subpackage Swieta_Na_Starowce/public/css
 */


@import url('page/utilities/region.css');
@import url('page/compositions/cluster.css');
@import url('page/compositions/flow.css');
@import url('page/compositions/grid.css');
@import url('page/compositions/repel.css');
@import url('page/compositions/sidebar.css');
@import url('page/compositions/switcher.css');
@import url('page/compositions/wrapper.css');
@import url('page/global/reset.css');
@import url('page/global/fonts.css');
@import url('page/global/global-styles.css');
@import url('page/global/variables.css');
@import url('page/blocks/button.css');
@import url('page/blocks/map.css');
@import url('page/blocks/swstrc.css');
@import url('page/blocks/checkout-blocks.css');
@import url('page/blocks/popup.css');
@import url('cf7-woocommerce-style.css');

:root {
    --swstrc-color-available: #5cb85c;
    --swstrc-color-in-cart: #f0ad4e;
    --region-space: var(--space-xl-2xl);
    --gutter: var(--space-s-m);
    --swstrc-color-reserved: #d9534f;
    --space-xl-2xl: clamp(3.375rem, 1.9304rem + 7.2231vw, 9rem);
    --space-s-m: clamp(1.125rem, .5472rem + 2.8892vw, 3.375rem);
}

.swstrc-map-container {
    overflow: hidden;
    position: relative;
    height: clamp(25rem, 4.661rem + 42.3729vw, 37.5rem);
    width: 100%;
}

.swstrc-map-elements {
    width: 100%;
    height: 100%;
    display: flex;
    background: #f8f9fa;
}

.swstrc-map-elements svg {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 600px;
    display: block;
    preserveAspectRatio: xMidYMid meet;
}

/* Responsive SVG sizing */
@media (max-width: 768px) {
    .swstrc-map-elements svg {
        height: 500px;
    }
}

@media (max-width: 480px) {
    .swstrc-map-elements svg {
        height: 400px;
    }
}

.swstrc-element-available circle,
.swstrc-element-available [fill] {
    fill: var(--swstrc-color-available) !important;
    transition: fill 0.2s ease;
}

.swstrc-element-in-cart circle,
.swstrc-element-in-cart [fill] {
    fill: var(--swstrc-color-in-cart) !important;
    transition: fill 0.2s ease;
}

/* Countdown Timer Section */
.swstrc-countdown-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 20px;
    margin: 20px 0;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    color: white;
}

.swstrc-countdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.swstrc-countdown-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.swstrc-countdown-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.25);
}

.swstrc-countdown-item h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.swstrc-countdown-item p {
    margin: 10px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
    font-style: italic;
}

/* Compact countdown timer styling within reservation map */
.swstrc-countdown-section .swstrc-countdown-timer {
    background: transparent;
    padding: 0;
    margin: 0;
    box-shadow: none;
    border: none;
    border-radius: 0;
}

.swstrc-countdown-section .swstrc-timer-display {
    justify-content: center;
    gap: 8px;
}

.swstrc-countdown-section .swstrc-timer-block {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 10px 12px;
    min-width: 50px;
    backdrop-filter: blur(5px);
}

.swstrc-countdown-section .swstrc-timer-value {
    font-size: 20px;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.swstrc-countdown-section .swstrc-timer-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 4px;
}

.swstrc-countdown-section .swstrc-timer-separator {
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    font-weight: 700;
    animation: swstrc-timer-pulse 1s infinite alternate;
}

/* Responsive design for countdown section */
@media (max-width: 768px) {
    .swstrc-countdown-section {
        padding: 20px 15px;
        margin: 15px 0;
    }

    .swstrc-countdown-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .swstrc-countdown-item {
        padding: 15px 10px;
    }

    .swstrc-countdown-item h3 {
        font-size: 16px;
    }

    .swstrc-countdown-section .swstrc-timer-block {
        padding: 8px 10px;
        min-width: 40px;
    }

    .swstrc-countdown-section .swstrc-timer-value {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .swstrc-countdown-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .swstrc-countdown-item {
        padding: 12px 8px;
    }

    .swstrc-countdown-item h3 {
        font-size: 14px;
    }
}

.swstrc-element-reserved circle,
.swstrc-element-reserved [fill] {
    fill: var(--swstrc-color-reserved) !important;
    transition: fill 0.2s ease;
}

.swstrc-map-elements g[class*="swstrc-element-"]:hover circle,
.swstrc-map-elements g[class*="swstrc-element-"]:hover [fill],
.swstrc-map-elements g[class*="swstrc-element-"]:focus-visible circle,
.swstrc-map-elements g[class*="swstrc-element-"]:focus-visible [fill] {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.swstrc-map-elements .swstrc-element-available circle,
.swstrc-map-elements .swstrc-element-available text {
    fill: var(--swstrc-color-available) !important;
}

.swstrc-map-elements .swstrc-element-in-cart circle,
.swstrc-map-elements .swstrc-element-in-cart text {
    fill: var(--swstrc-color-in-cart) !important;
}

.swstrc-map-elements .swstrc-element-reserved circle,
.swstrc-map-elements .swstrc-element-reserved text {
    fill: var(--swstrc-color-reserved) !important;
}

.swstrc-map-elements svg g.swstrc-element-available circle,
.swstrc-map-elements svg g.swstrc-element-available text {
    fill: var(--swstrc-color-available) !important;
}

.swstrc-map-elements svg g.swstrc-element-in-cart circle,
.swstrc-map-elements svg g.swstrc-element-in-cart text {
    fill: var(--swstrc-color-in-cart) !important;
}

.swstrc-map-elements svg g.swstrc-element-reserved circle,
.swstrc-map-elements svg g.swstrc-element-reserved text {
    fill: var(--swstrc-color-reserved) !important;
}

/* SVG element styling for dynamically generated SVG */
.swstrc-map-element {
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Hide ugly SVG text labels */
.swstrc-map-elements text {
    display: none;
    visibility: hidden;
}

.swstrc-map-elements .swstrc-element-available text,
.swstrc-map-elements .swstrc-element-in-cart text,
.swstrc-map-elements .swstrc-element-reserved text {
    display: none;
    visibility: hidden;
}

.swstrc-element-available {
    fill: #2e7d32;
    cursor: pointer;
}

.swstrc-element-reserved {
    fill: #d32f2f;
    cursor: not-allowed;
}

.swstrc-map-element:hover {
    opacity: 0.8;
}

.swstrc-element-available {
    fill: #2e7d32;
}

.swstrc-element-reserved {
    fill: #d32f2f;
}

.swstrc-element-in-cart {
    fill: #ff9800;
    opacity: 0.7;
    pointer-events: none;
    cursor: pointer;
}

.swstrc-element-in-cart.swstrc-processing {
    cursor: wait;
}

.swstrc-element-processing {
    opacity: 0.7;
    pointer-events: none;
    cursor: wait;
}

.swstrc-element-disabled {
    cursor: not-allowed;
    pointer-events: none;
}

.swstrc-reservation-page {
    --wp--preset--spacing--60: 0px;
    --wp--style--root--padding-right: 0px;
    --wp--style--root--padding-left: 0px;
    --wp--style--global--content-size: 100%;

    .entry-content {
        margin-block-start: 0px;
    }
}

/* Selection Display Styles */
.map-container__selection-list {
    --flow-space: var(--space-xs);
}

.map-container__selection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2xs) 0;
    border-bottom: 1px solid var(--color-mid, #e0e0e0);
}

.map-container__selection-info {
    display: flex;
    align-items: center;
    gap: var(--space-3xs);
}

.map-container__checkout-actions {
    padding-block: var(--space-2xs) 0;
}

.map-container__selection-legend {
    flex-shrink: 0;
    display: inline-flex;
}

.map-container__selection-details {
    display: flex;
    align-items: center;
    gap: var(--space-3xs);
    flex-wrap: wrap;
}

.map-container__selection-id {
    font-weight: var(--font-medium, 500);
    color: var(--color-dark, #333);
}

.map-container__selection-price {
    font-weight: var(--font-bold, 600);
    white-space: nowrap;
}

.map-container__selection-empty {
    text-align: center;
    color: var(--color-mid, #666);
    font-style: italic;
    padding: var(--space-s) 0;
}

#swstrc-mobile-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Better visibility for map points on mobile */
@media (max-width: 768px) {
    .swstrc-map-elements circle {
        stroke-width: 3px !important;
        opacity: 0.8 !important;
    }

    .swstrc-map-elements text {
        font-size: 12px !important;
        font-weight: bold !important;
        opacity: 1 !important;
    }

    .swstrc-element-available circle {
        fill: #5cb85c !important;
        opacity: 0.9 !important;
    }

    .swstrc-element-reserved circle {
        fill: #d9534f !important;
        opacity: 0.9 !important;
    }

    .swstrc-element-in-cart circle {
        fill: #f0ad4e !important;
        opacity: 0.9 !important;
    }
}

/* Even better visibility for touch devices */
@media (hover: none) and (pointer: coarse) {
    .swstrc-map-elements circle {
        stroke-width: 4px !important;
        opacity: 0.85 !important;
        cursor: pointer !important;
    }

    .swstrc-map-elements text {
        font-size: 14px !important;
        font-weight: bold !important;
        opacity: 1 !important;
        pointer-events: none;
    }

    .swstrc-element-available circle {
        fill: #5cb85c !important;
        opacity: 0.95 !important;
    }

    .swstrc-element-reserved circle {
        fill: #d9534f !important;
        opacity: 0.95 !important;
    }

    .swstrc-element-in-cart circle {
        fill: #f0ad4e !important;
        opacity: 0.95 !important;
    }
}

.swstrc-map-elements svg g[data-transparent="true"] {
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.swstrc-map-elements svg g[data-transparent="true"]:hover {
    opacity: 0.6;
}

/* Event View Mode Styles */
.swstrc-map-search-container {
    margin-bottom: 20px;
    position: relative;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.swstrc-search-wrapper {
    position: relative;
}

#swstrc-map-search-input {
    width: 100%;
    padding: 15px 20px;
    padding-right: 40px;
    border: 2px solid #e1e1e1;
    border-radius: 30px;
    font-size: 16px;
    transition: all 0.3s ease;
}

#swstrc-map-search-input:focus {
    border-color: #c41e3a;
    /* Christmas Red */
    outline: none;
    box-shadow: 0 0 10px rgba(196, 30, 58, 0.1);
}

.swstrc-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #999;
}

.swstrc-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.swstrc-search-result-item {
    padding: 10px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.swstrc-search-result-item:last-child {
    border-bottom: none;
}

.swstrc-search-result-item:hover {
    background-color: #f9f9f9;
}

.swstrc-result-name {
    font-weight: bold;
    color: #333;
}

.swstrc-result-meta {
    font-size: 0.9em;
    color: #666;
}

.swstrc-event-view-mode .map-container__add-to-cart,
.swstrc-event-view-mode .swstrc-add-to-cart {
    display: none !important;
}

.swstrc-highlighted {
    stroke: #c41e3a !important;
    stroke-width: 5px !important;
    fill: #ffeb3b !important;
    transition: all 0.5s;
}

.highlight-row {
    background-color: #fff3cd !important;
    transition: background-color 0.5s;
}

/* Search Results Styles */
.swstrc-search-result-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.swstrc-search-result-item:last-child {
    border-bottom: none;
}

.swstrc-search-result-item:hover {
    background-color: #f9f9f9;
}

.swstrc-result-name {
    font-weight: bold;
    color: #333;
}

.swstrc-result-meta {
    font-size: 0.9em;
    color: #666;
}

.swstrc-exhibitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-xs);
    margin-block: var(--space-xs);
}

.swstrc-exhibitor-card {
    background: var(--color-light);
    border: 1px solid var(--color-light-shade);
    border-radius: var(--radius);
    padding: var(--space-xs);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    height: 100%;
}

.swstrc-exhibitor-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary);
}

/* Highlighted state (from search) */
.swstrc-exhibitor-card.highlight-row {
    animation: swstrc-flash 2s ease;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 2px var(--color-secondary);
}

.swstrc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-light-shade);
    padding-bottom: var(--space-2xs);
    margin-bottom: var(--space-2xs);
}

.swstrc-card-id {
    color: var(--color-primary);
    font-weight: var(--font-bold);
    font-size: var(--size-step-0);
}

.swstrc-card-type {
    font-size: var(--text-size-small);
    color: var(--color-mid);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.swstrc-card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}

.swstrc-exhibitor-name {
    font-family: var(--font-display);
    font-weight: var(--font-bold);
    font-size: var(--size-step-1);
    color: var(--color-dark);
}

.swstrc-stand-assortment {
    font-size: var(--text-size-base);
    color: var(--color-dark);
    line-height: var(--leading);
    word-break: break-word;
}

.swstrc-card-footer {
    margin-top: var(--space-s);
    display: flex;
    justify-content: flex-end;
}

.swstrc-locate-on-map-btn {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-s);
    padding: var(--space-2xs) var(--space-s);
    font-size: var(--text-size-small);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
}

.swstrc-locate-on-map-btn:hover {
    background: var(--color-primary);
    color: var(--color-light);
}

/* Pulsating Animation for Map Elements */
@keyframes swstrc-pulsate {
    0% {
        transform: scale(1);
        opacity: 1;
        stroke-width: 2px;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.8;
        stroke-width: 4px;
        stroke: var(--color-secondary);
    }

    100% {
        transform: scale(1);
        opacity: 1;
        stroke-width: 2px;
    }
}

/* Use SVG specific transform origin */
.swstrc-map-pulsate {
    animation: swstrc-pulsate 1.5s infinite;
    transform-box: fill-box;
    transform-origin: center;
    z-index: 1000;
}

/* Flash animation for grid items */
@keyframes swstrc-flash {
    0% {
        background-color: var(--color-light);
    }

    10% {
        background-color: var(--color-secondary-light);
    }

    100% {
        background-color: var(--color-light);
    }
}

.swstrc-icon-map {
    font-style: normal;
}

/* --- SKELETON LOADING ANIMATION --- */
.swstrc-loading-dots {
    display: inline-block;
    width: 100%;
    height: 1.2em; /* Approximately one line of text */
    background: #f0f0f0;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    color: transparent !important; /* Hide the dots text */
}

.swstrc-loading-dots::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translateX(-100%);
    animation: swstrc-skeleton-shimmer 1.5s infinite;
}

/* Adjust height for name vs assortment to look slightly different */
.swstrc-exhibitor-name .swstrc-loading-dots {
    height: 1.4em;
    width: 70%; /* Name is usually shorter */
    margin-bottom: 0.2em;
}

.swstrc-stand-assortment .swstrc-loading-dots {
    height: 1em;
    width: 90%;
}

@keyframes swstrc-skeleton-shimmer {
    100% {
        transform: translateX(100%);
    }
}