/* =============================================== */
/*            CRYPTO ATM CONTENT STYLES          */
/*              INDUSTRIAL DESIGN                */
/* =============================================== */

:root {
    --safe-zone-bottom-map: calc(max(calc(100vh - 100dvh) + var(--safe-zone-bottom)));
    /*--safe-zone-bottom-map: var(--safe-zone-bottom);*/
}

body {
    touch-action: manipulation;
}

/* Pro kontejner Google Maps */
#map {
    touch-action: manipulation;
    /* nebo 'pan-x pan-y zoom' */
    overscroll-behavior: contain;
    /* Zajistí focus capture */
    outline: none;
}

/* MAIN HEADER */
.main-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.main-header h1 {
    color: var(--primary-color, #333);
    margin-bottom: 5px;
    font-size: 2.2em;
    font-weight: 700;
}

.main-header p {
    color: #666;
    font-size: 0.95em;
}

/* OVERRIDE Google Maps controls styling */
.gm-bundled-control {
    /* top: 100svh !important; */
    /* bottom: auto !important; */
    /* transform: translateY(-200px) !important ;*/
    /*  transform: translateY(calc(-1 * var(--info-panel-handle-height) - var(--safe-zone-bottom)))  !important; */
    margin-top: max(15px, var(--safe-zone-top)) !important;
    margin-left: max(15px, var(--safe-zone-left)) !important;
    margin-bottom: calc(var(--safe-zone-bottom-map) + var(--info-panel-handle-height)) !important;
    margin-right: max(10px, var(--safe-zone-right)) !important;
}

.gm-style-mtc-bbw {
    margin-top: max(15px, var(--safe-zone-top)) !important;
    margin-left: calc(max(15px, var(--safe-zone-left)) + 53px) !important;
}

.gm-fullscreen-control {
    margin-top: max(15px, var(--safe-zone-top)) !important;
    margin-right: max(15px, var(--safe-zone-right)) !important;
}

.gm-svpc {
    margin-right: max(15px, var(--safe-zone-right)) !important;
    margin-bottom: max(80px, calc(var(--safe-zone-bottom) + 45px)) !important;
}


/* MAP SECTION - Fullscreen */
.map-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent;
    padding: 0;
    margin: 0;
    border: none;
    box-shadow: none;
    border-radius: 0;
    z-index: 1000;
    /* Nižší než shell panely (9998) */
}

.map-container {
    width: 100%;
    height: 100%;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    background: #f8f9fa;
}

/* FULLSCREEN BUTTON */
.fullscreen-button {
    position: absolute;
    top: max(14px, var(--safe-zone-top));
    right: max(13px, var(--safe-zone-right));
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    color: #333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* Zakázat výběr textu */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.fullscreen-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.fullscreen-button:active {
    transform: scale(0.95);
}

/* Skrýt fullscreen tlačítko na iPhone/iOS */
@supports (-webkit-touch-callout: none) {
    .fullscreen-button {
        display: none;
    }
}

/* ZOOM INDICATOR */
.zoom-indicator {
    position: absolute;
    top: 70px;
    right: 11px;
    background: linear-gradient(135deg, #4a5a6e 0%, #2980b9 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 4900;
    /* Nad mapou (1000) ale pod panely (9998) */
}

.zoom-label {
    margin-right: 5px;
}

.zoom-value {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
}

/* WEBSOCKET STATUS */
.websocket-status {
    position: absolute;
    top: 115px;
    right: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 4900;
    /* Nad mapou (1000) ale pod panely (9998) */
    display: flex;
    align-items: center;

    /* Zakázat výběr textu */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    gap: 6px;
}

.websocket-status.connecting {
    background: linear-gradient(135deg, #85929e 0%, #f39c12 100%);
    color: white;
}

.websocket-status.connected {
    background: linear-gradient(135deg, #1e8449 0%, #27ae60 100%);
    color: white;
}

.websocket-status.disconnected {
    background: linear-gradient(135deg, #b8541a 0%, #e67e22 100%);
    color: white;
}

.ws-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 0.3;
    }
}

/* ATM DETAILS PANEL */
.atm-details-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    padding: 0;
    margin-bottom: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.atm-details-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.atm-details-header h2 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
}

.atm-header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.view-mode-buttons {
    display: flex;
    gap: 8px;
}

.view-mode-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-mode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.view-mode-btn.active {
    background: linear-gradient(135deg, #b8541a 0%, #e67e22 100%);
    color: white;
    border-color: #e67e22;
}

.mode-icon {
    font-size: 1em;
}

.mode-text {
    font-weight: 500;
}

.close-details-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-details-btn:hover {
    background: rgba(255, 0, 0, 0.3);
    color: white;
}

.atm-details-content {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

/* FILTER CONTROLS */
.filter-controls {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section h3 {
    color: var(--primary-color, #333);
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
}

.filter-section:last-of-type {
    margin-bottom: 0;
}

.filter-actions {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.filter-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.apply-btn {
    background: linear-gradient(135deg, #1e8449 0%, #27ae60 100%);
    color: white;
}

.apply-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.reset-btn {
    background: linear-gradient(135deg, #b8541a 0%, #e67e22 100%);
    color: white;
}

.reset-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.4);
}

/* MOBILE PANEL CONTENT */
.mobile-panel-content {
    padding: 15px;
}

.mobile-atm-info {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 15px;
}

.mobile-atm-info h3 {
    color: var(--primary-color, #333);
    margin-bottom: 10px;
    font-size: 1.2em;
}

.mobile-atm-details {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}

.mobile-atm-details h3 {
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 1.1em;
}

.mobile-atm-details p {
    margin-bottom: 6px;
    color: #666;
    font-size: 0.9em;
}

.atm-details-btn {
    background: linear-gradient(135deg, #2471a3 0%, #3498db 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.atm-details-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.4);
}

/* CRYPTO ATM CONTAINER */
.crypto-atm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
}

/* RESPONSIVE DESIGN */
body[data-device="mobile"] .map-container {
    height: 400px;
}

body[data-device="tablet"] .map-container {
    height: 450px;
}

body[data-device="desktop"] .map-container {
    height: 500px;
}

body[data-device="mobile"] .zoom-indicator,
body[data-device="mobile"] .websocket-status {
    font-size: 0.75em;
    padding: 6px 10px;
}

body[data-device="mobile"] .view-mode-buttons {
    flex-direction: column;
    gap: 4px;
}

body[data-device="mobile"] .view-mode-btn {
    padding: 4px 8px;
    font-size: 0.7em;
}

body[data-device="mobile"] .mode-text {
    display: none;
}

/* INFO WINDOW CONTENT STYLING (pro infoPanel panel) */
.info-window-content {

    padding: 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.4;
    max-width: 100%;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.operator-logo-small {
    height: 20px;
    width: auto;
    border-radius: 3px;
}

.operator-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1em;
}

.info-location {
    margin-bottom: 15px;
}

.location-title {
    font-weight: 600;
    color: #34495e;
    font-size: 1em;
    margin-bottom: 4px;
}

.location-address {
    color: #7f8c8d;
    font-size: 0.9em;
}

.info-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    justify-content: center;
    color: #7f8c8d;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ecf0f1;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.info-operations {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 11px;
}

.operations-label {
    color: #666;
}

.operations-buttons {
    display: flex;
    gap: 10px;
}

.op-buy,
.op-sell {
    font-weight: bold;
    font-size: 10px;
}

.op-buy {
    color: #2e7d32;
}

.op-sell {
    color: #d84315;
}

.info-crypto-list {
    margin-bottom: 8px;
}

.crypto-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    font-size: 11px;
}

.crypto-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.crypto-icon {
    font-size: 12px;
    font-weight: bold;
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    box-shadow: none;
    display: inline;
    padding: 2px 4px;
}

.crypto-symbol {
    font-weight: 600;
    color: #2c3e50;
    min-width: 40px;
}

.crypto-operations {
    display: flex;
    gap: 15px;
    align-items: center;
}

.crypto-buy,
.crypto-sell {
    font-size: 12px;
    font-weight: bold;
    width: 12px;
    text-align: center;
}

.crypto-buy.available,
.crypto-sell.available {
    color: #4caf50;
}

.crypto-buy.unavailable,
.crypto-sell.unavailable {
    color: #f44336;
}

.info-fiat {
    font-size: 11px;
    color: #666;
    margin-bottom: 6px;
}

.info-atm-type {
    font-size: 11px;
    color: #666;
    margin-bottom: 6px;
}

.info-buttons {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.info-btn {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.info-btn-details {
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
    color: white;
}

.info-btn-directions {
    background: linear-gradient(135deg, #2471a3 0%, #3498db 100%);
    color: white;
}

.info-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* MOBILE RESPONSIVE */
body[data-device="mobile"] .info-window-content {
    padding: 12px;
}

body[data-device="mobile"] .info-buttons {
    flex-direction: column;
}

body[data-device="mobile"] .info-btn {
    min-width: auto;
}

body[data-device="mobile"] .mobile-hide {
    display: none;
}

/* PRINT STYLES */
@media print {

    .zoom-indicator,
    .websocket-status,
    .filter-controls,
    .mobile-panel-content,
    .info-window-content {
        display: none;
    }

    .map-container {
        height: 300px;
        background: #eee;
    }
}