/**
 * Ax-Easy EasyStorage Platform
 * Visual Map Styles
 * Version: 1.3.0
 */

/* ============================================
   MAP CONTAINER
   ============================================ */
.estorage-map-container {
    margin: 40px auto;
    max-width: 1400px;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.estorage-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #FF6B2C;
}

.estorage-map-header h2 {
    margin: 0;
    color: #111827;
}

/* ============================================
   LEGEND
   ============================================ */
.estorage-map-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    font-weight: 500;
    color: #374151;
}

.legend-item::before {
    content: "●";
    font-size: 0.8em;
    filter: drop-shadow(0 0 3px currentColor);
}

.legend-item.available::before {
    color: #10B981;
}

.legend-item.occupied::before {
    color: #EF4444;
}

.legend-item.reserved::before {
    color: #F59E0B;
}

.legend-item.ending-soon::before {
    color: #FF6B2C;
}

/* ============================================
   PRODUCT SECTION
   ============================================ */
.estorage-product-section {
    margin-bottom: 40px;
}

.product-section-title {
    margin: 0 0 20px 0;
    padding: 12px 20px;
    background: linear-gradient(135deg, #F3F4F6 0%, #fff 100%);
    border-left: 4px solid #FF6B2C;
    font-size: 1.2em;
    color: #111827;
}

/* ============================================
   GRID LAYOUT - COMPACT BOXES
   ============================================ */
.estorage-map-grid {
    display: grid;
    gap: 8px;
    margin-top: 20px;
    width: 100%;
    max-width: 100%;
}

.estorage-slot-box {
    position: relative;
    padding: 10px 6px;
    background: #F3F4F6;
    border: 2px solid #E5E7EB;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 70px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 0.9em;
    overflow: hidden;
}

.estorage-slot-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
    z-index: 10;
}

/* Status Colors */
.slot-available {
    background: #ECFDF5;
    border-color: #10B981;
}

.slot-occupied {
    background: #FEE2E2;
    border-color: #EF4444;
}

.slot-reserved {
    background: #FEF3C7;
    border-color: #F59E0B;
}

.slot-ending-soon {
    background: #FFEDD5;
    border-color: #FF6B2C;
}

/* Slot Elements */
.slot-status-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 6px currentColor;
}

/* LED colors matching legend */
.slot-available .slot-status-icon {
    background: #10B981;
    box-shadow: 0 0 8px #10B981, inset 0 0 4px rgba(255,255,255,0.5);
}

.slot-occupied .slot-status-icon {
    background: #EF4444;
    box-shadow: 0 0 8px #EF4444, inset 0 0 4px rgba(255,255,255,0.5);
}

.slot-reserved .slot-status-icon {
    background: #F59E0B;
    box-shadow: 0 0 8px #F59E0B, inset 0 0 4px rgba(255,255,255,0.5);
}

.slot-ending-soon .slot-status-icon {
    background: #FF6B2C;
    box-shadow: 0 0 8px #FF6B2C, inset 0 0 4px rgba(255,255,255,0.5);
}

.slot-id {
    font-size: 0.85em;
    font-weight: 700;
    color: #111827;
    margin-bottom: 3px;
    font-family: monospace;
    line-height: 1.2;
}

.slot-detail {
    font-size: 0.7em;
    color: #374151;
    font-weight: 600;
    font-family: monospace;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
}

.slot-barcode {
    font-size: 0.65em;
    color: #6B7280;
    font-family: monospace;
    margin-top: 2px;
    line-height: 1.2;
}

/* ============================================
   MODAL ENHANCEMENTS
   ============================================ */
.slot-modal-subtitle {
    margin: 5px 0 0 0;
    color: #6B7280;
    font-size: 0.9em;
}

.slot-modal-body hr {
    border: none;
    border-top: 1px solid #E5E7EB;
}

.slot-modal-body .pricing-summary {
    margin: 15px 0;
    padding: 12px;
    background: #F9FAFB;
    border-radius: 6px;
}

.slot-modal-body .pricing-summary h4 {
    margin: 0 0 8px 0;
    font-size: 1em;
    color: #111827;
}

.slot-modal-body .pricing-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.slot-modal-body .pricing-summary li {
    padding: 4px 0;
    color: #374151;
}

/* ============================================
   RESPONSIVE - COMPACT
   ============================================ */
@media (max-width: 768px) {
    .estorage-map-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)) !important;
        gap: 8px;
    }
    
    .estorage-slot-box {
        padding: 10px 6px;
        min-height: 70px;
    }
    
    .slot-id {
        font-size: 0.85em;
    }
    
    .slot-detail {
        font-size: 0.75em;
    }
    
    .product-section-title {
        font-size: 1.1em;
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .estorage-map-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)) !important;
        gap: 6px;
    }
    
    .estorage-slot-box {
        padding: 8px 4px;
        min-height: 60px;
    }
    
    .slot-id {
        font-size: 0.75em;
    }
    
    .slot-detail {
        font-size: 0.7em;
    }
}


/* ============================================
   SVG LAYOUT
   ============================================ */
.estorage-map-svg {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.estorage-map-svg svg {
    width: 100%;
    height: auto;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
}

.slot-svg-rect {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.slot-svg-rect:hover {
    opacity: 0.8;
}

/* ============================================
   IMAGE MAP LAYOUT
   ============================================ */
.estorage-image-map-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.estorage-image-map-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ============================================
   MODAL
   ============================================ */
.estorage-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.estorage-modal-content {
    background-color: #fff;
    padding: 0;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.estorage-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #6B7280;
    cursor: pointer;
    z-index: 1;
    line-height: 1;
}

.estorage-modal-close:hover {
    color: #111827;
}

.slot-modal-header {
    padding: 25px 30px;
    background: linear-gradient(135deg, #F3F4F6 0%, #fff 100%);
    border-bottom: 3px solid #FF6B2C;
}

.slot-modal-header h3 {
    margin: 0;
    color: #111827;
    font-size: 1.4em;
}

.slot-modal-body {
    padding: 25px 30px;
}

.slot-modal-body p {
    margin: 12px 0;
    line-height: 1.6;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
}

.status-badge.status-available {
    background: #ECFDF5;
    color: #065F46;
}

.status-badge.status-occupied {
    background: #FEE2E2;
    color: #991B1B;
}

.status-badge.status-reserved {
    background: #FEF3C7;
    color: #92400E;
}

.status-badge.status-ending-soon {
    background: #FFEDD5;
    color: #9A3412;
}

.pricing-summary {
    margin: 20px 0;
    padding: 15px;
    background: #F9FAFB;
    border-radius: 8px;
}

.pricing-summary h4 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #111827;
}

.pricing-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pricing-summary li {
    padding: 5px 0;
    color: #374151;
}

.slot-modal-body .button {
    display: inline-block;
    width: 100%;
    margin-top: 20px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #FF6B2C 0%, #FF8555 100%);
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.slot-modal-body .button:hover {
    background: linear-gradient(135deg, #E55A1F 0%, #FF6B2C 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(255, 107, 44, 0.3);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .estorage-map-container {
        padding: 20px;
    }
    
    .estorage-map-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .estorage-map-legend {
        gap: 10px;
    }
    
    .legend-item {
        font-size: 0.85em;
    }
    
    .estorage-map-grid {
        gap: 10px;
    }
    
    .estorage-slot-card {
        padding: 15px;
    }
    
    .slot-id {
        font-size: 1.1em;
    }
    
    .estorage-modal-content {
        width: 95%;
    }
    
    .slot-modal-header,
    .slot-modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .estorage-map-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)) !important;
    }
}
