/**
 * Marigab Sunbeds Interactive Map Stylesheet
 * Brand Identity Palette: Gold (#ba985f), Dark Leather (#4F271D), Parsley (#144716), Turquoise Stone (#00c7ef)
 *
 * @package Marigab_Sunbeds
 */

.marigab-sunbeds-wrapper {
    /* Official Brand Colors */
    --brand-gold: #ba985f;
    --brand-gold-light: #e6cb96;
    --brand-dark-leather: #4F271D;
    --brand-dark-leather-deep: #2a130e;
    --brand-parsley: #144716;
    --brand-parsley-light: #216d24;
    --brand-turquoise: #00c7ef;

    /* Theme Tokens */
    --ms-bg-dark: #160a07;
    --ms-card-bg: #27140f;
    --ms-accent-gold: var(--brand-gold);
    --ms-accent-green: var(--brand-parsley-light);
    --ms-accent-turquoise: var(--brand-turquoise);
    --ms-text-main: #fdfbf7;
    --ms-text-muted: #c9b0a7;
    
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: var(--ms-bg-dark);
    color: var(--ms-text-main);
    border: 1px solid rgba(186, 152, 95, 0.35);
    border-radius: 18px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(186, 152, 95, 0.08);
    overflow: hidden;
    margin: 24px 0;
    position: relative;
    box-sizing: border-box;
}

.marigab-sunbeds-wrapper * {
    box-sizing: border-box;
}

/* Header Section */
.marigab-sunbeds-header {
    padding: 24px 28px;
    background: linear-gradient(180deg, #371a13 0%, #230f0a 100%);
    border-bottom: 1px solid rgba(186, 152, 95, 0.25);
    text-align: center;
}

.marigab-sunbeds-title {
    font-size: 1.85rem;
    font-weight: 700;
    margin: 0 0 6px 0;
    background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.01em;
}

.marigab-sunbeds-subtitle {
    color: var(--ms-text-muted);
    font-size: 0.95rem;
    margin: 0;
}

/* Control Toolbar */
.marigab-sunbeds-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--ms-card-bg);
    padding: 14px 24px;
    border-bottom: 1px solid rgba(186, 152, 95, 0.2);
    flex-wrap: wrap;
    gap: 16px;
}

.marigab-zone-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--brand-gold-light);
}

.marigab-zone-filter select {
    background: var(--brand-dark-leather-deep);
    color: var(--ms-text-main);
    border: 1px solid rgba(186, 152, 95, 0.4);
    padding: 8px 14px;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    font-size: 0.88rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.marigab-zone-filter select:focus {
    border-color: var(--brand-gold);
    box-shadow: 0 0 10px rgba(186, 152, 95, 0.3);
}

/* Legend */
.marigab-legend {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 0.85rem;
}

.marigab-legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--ms-text-muted);
    font-weight: 500;
}

.marigab-legend-dot {
    width: 13px;
    height: 13px;
    border-radius: 4px;
}

.marigab-legend-dot.available { background: var(--brand-parsley);        border: 1px solid var(--brand-gold); }
.marigab-legend-dot.selected  { background: var(--brand-gold);           border: 1px solid var(--brand-dark-leather); }
.marigab-legend-dot.reserved  { background: var(--brand-dark-leather);   border: 1px solid #754238; }

/* Zoom Controls */
.marigab-zoom-controls {
    display: flex;
    gap: 8px;
}

.marigab-zoom-btn {
    background: var(--brand-dark-leather-deep);
    color: var(--brand-gold-light);
    border: 1px solid rgba(186, 152, 95, 0.35);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
}

.marigab-zoom-btn:hover {
    background: #3a1c15;
    border-color: var(--brand-gold);
    color: #ffffff;
}

.marigab-zoom-btn:active {
    transform: scale(0.94);
}

/* Map Canvas Viewport */
.marigab-map-viewport {
    width: 100%;
    height: 620px;
    background: #110705;
    position: relative;
    overflow: hidden;
    user-select: none;
    cursor: grab;
}

.marigab-map-viewport:active {
    cursor: grabbing;
}

.marigab-map-viewport svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* SVG Elements Styling */
.sunbed-group {
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.2s ease;
}

.sunbed-group:hover {
    filter: drop-shadow(0 0 10px rgba(0, 199, 239, 0.75));
}

.sunbed-rect {
    rx: 3px;
    ry: 3px;
    transition: fill 0.2s, stroke 0.2s, stroke-width 0.2s;
}

/* Sunbed Statuses */
.sunbed-group.status-available .sunbed-rect {
    fill: var(--brand-parsley);
    stroke: var(--brand-gold);
    stroke-width: 1.4px;
}

.sunbed-group.status-available:hover .sunbed-rect {
    fill: var(--brand-parsley-light);
    stroke: var(--brand-gold-light);
    stroke-width: 1.8px;
}

.sunbed-group.status-selected .sunbed-rect {
    fill: var(--brand-gold);
    stroke: #ffffff;
    stroke-width: 2.2px;
}

.sunbed-group.status-selected:hover .sunbed-rect {
    fill: var(--brand-gold-light);
}

.sunbed-group.status-reserved {
    cursor: not-allowed;
    opacity: 0.65;
}

.sunbed-group.status-reserved .sunbed-rect {
    fill: var(--brand-dark-leather);
    stroke: #754238;
    stroke-width: 1.2px;
}

.sunbed-label {
    font-size: 8px;
    font-weight: 700;
    fill: #ffffff;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

.sunbed-group.status-selected .sunbed-label {
    fill: var(--brand-dark-leather-deep);
}

/* Dynamic Tooltip */
.marigab-map-tooltip {
    position: absolute;
    background: rgba(35, 15, 10, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--brand-gold);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    pointer-events: none;
    display: none;
    z-index: 50;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(186, 152, 95, 0.2);
    line-height: 1.5;
    max-width: 220px;
    white-space: normal;
}

@media (hover: none), (pointer: coarse), (max-width: 768px) {
    .marigab-map-tooltip {
        display: none !important;
    }
}

.marigab-map-tooltip strong {
    color: var(--brand-gold-light);
    font-size: 0.98rem;
}

/* Selection Bottom Drawer */
.marigab-selection-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: rgba(39, 20, 15, 0.96);
    backdrop-filter: blur(16px);
    border: 1px solid var(--brand-gold);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), 0 0 20px rgba(186, 152, 95, 0.3);
    padding: 12px 26px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 22px;
    z-index: 40;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 90%;
}

.marigab-selection-bar.active {
    transform: translateX(-50%) translateY(0);
}

.marigab-selection-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.marigab-badge-count {
    background: var(--brand-gold);
    color: var(--brand-dark-leather-deep);
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.88rem;
}

.marigab-selected-beds-text {
    color: var(--ms-text-main);
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.marigab-total-price {
    color: var(--brand-turquoise);
    font-weight: 700;
    font-size: 1.05rem;
    padding-left: 14px;
    border-left: 1px solid rgba(186, 152, 95, 0.3);
}

.marigab-btn-reserve {
    background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold));
    color: var(--brand-dark-leather-deep);
    font-weight: 800;
    border: none;
    padding: 11px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.92rem;
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s;
}

.marigab-btn-reserve:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(186, 152, 95, 0.6);
}

/* Modal Popup */
.marigab-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 7, 5, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.marigab-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.marigab-modal-content {
    background: #27140f;
    border: 1px solid var(--brand-gold);
    border-radius: 18px;
    padding: 30px;
    max-width: 480px;
    width: 90%;
    color: white;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 25px rgba(186, 152, 95, 0.2);
    transform: scale(0.9);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.marigab-modal-overlay.active .marigab-modal-content {
    transform: scale(1);
}

.marigab-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(186, 152, 95, 0.3);
    padding-bottom: 14px;
}

.marigab-modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brand-gold-light);
}

.marigab-modal-close {
    background: none;
    border: none;
    color: var(--ms-text-muted);
    font-size: 1.6rem;
    cursor: pointer;
}

.marigab-modal-close:hover {
    color: var(--brand-gold);
}

.marigab-modal-body {
    font-size: 0.95rem;
    color: var(--ms-text-main);
    line-height: 1.5;
}

.marigab-modal-footer {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

.marigab-btn-close-modal {
    background: var(--brand-gold);
    color: var(--brand-dark-leather-deep);
    font-weight: 700;
    border: none;
    padding: 9px 20px;
    border-radius: 8px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .marigab-sunbeds-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .marigab-map-viewport {
        height: 480px;
    }

    .marigab-selected-beds-text {
        max-width: 120px;
    }
}
