/**
 * Vyhledejte Maps Styles
 * CSS styly pro zobrazení map na frontendu i v adminu
 */

/* === FRONTEND MAPY === */

.vyhledejte-maps-container {
    position: relative;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.vyhledejte-maps-canvas {
    width: 100%;
    height: 100%;
    min-height: 300px;
}

/* Info panel nahoře */
.vyhledejte-maps-info {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    background: white;
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.vyhledejte-maps-location {
    font-size: 16px;
    color: #333;
}

.vyhledejte-maps-coordinates {
    font-size: 12px;
    color: #666;
    font-family: monospace;
}

.vyhledejte-maps-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Tlačítka */
.vyhledejte-maps-btn {
    padding: 8px 12px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
}

.vyhledejte-maps-btn:hover {
    background: #1565c0;
    color: white;
    text-decoration: none;
}

.vyhledejte-maps-btn.secondary {
    background: #757575;
}

.vyhledejte-maps-btn.secondary:hover {
    background: #616161;
}

/* Loading overlay */
.vyhledejte-maps-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1976d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #666;
    font-size: 14px;
}

/* Fullscreen mode */
.vyhledejte-maps-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    margin: 0;
    border-radius: 0;
    z-index: 99999;
}

.vyhledejte-maps-container.fullscreen .vyhledejte-maps-canvas {
    height: 100vh !important;
}

/* Error messages */
.vyhledejte-maps-error {
    padding: 20px;
    background: #ffebee;
    border: 1px solid #ef5350;
    border-radius: 4px;
    color: #c62828;
    margin: 20px 0;
}

.vyhledejte-maps-error a {
    color: #1976d2;
    text-decoration: underline;
}

/* === ADMIN STYLY === */

.vyhledejte-maps-admin h1 {
    margin-bottom: 20px;
}

.vyhledejte-maps-admin h2 {
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

/* Statistiky */
.vyhledejte-stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stats-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stats-card .stats-number {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 8px;
}

.stats-card .stats-label {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Test sekce */
.vyhledejte-maps-test-section {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
}

.vyhledejte-maps-test-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 15px 0;
    flex-wrap: wrap;
}

.vyhledejte-maps-test-controls input[type="text"] {
    flex: 1;
    min-width: 250px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.vyhledejte-maps-test-result {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.vyhledejte-maps-examples {
    margin-top: 15px;
}

.vyhledejte-maps-examples ul {
    list-style: disc;
    padding-left: 20px;
}

.vyhledejte-maps-examples ul li {
    margin: 5px 0;
}

.vyhledejte-maps-examples code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    border: 1px solid #ddd;
}

/* Cache management */
.vyhledejte-maps-cache-section {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
}

.vyhledejte-maps-cache-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.vyhledejte-maps-cache-stat {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
}

.vyhledejte-maps-cache-stat .number {
    font-size: 24px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 5px;
}

.vyhledejte-maps-cache-stat .label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.vyhledejte-maps-cache-controls {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

/* Shortcode dokumentace */
.vyhledejte-maps-shortcode-docs {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
}

.vyhledejte-maps-shortcode-docs pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 12px 16px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
}

.vyhledejte-maps-shortcode-docs code {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.vyhledejte-maps-example {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
}

.vyhledejte-maps-example h5 {
    margin: 0 0 5px 0;
    color: #0073aa;
}

.vyhledejte-maps-example code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

.vyhledejte-maps-example p {
    margin: 5px 0 0 0;
    color: #666;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
    .vyhledejte-maps-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .vyhledejte-maps-controls {
        width: 100%;
    }
    
    .vyhledejte-maps-btn {
        flex: 1;
        justify-content: center;
    }
    
    .vyhledejte-stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .vyhledejte-maps-test-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .vyhledejte-maps-test-controls input[type="text"] {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .vyhledejte-stats-cards {
        grid-template-columns: 1fr;
    }
}

/* WordPress notice override */
#maps-api-test-result .notice,
#detection-output .notice,
#cache-management-result .notice {
    margin: 10px 0 !important;
    padding: 12px !important;
}

/* Table styling v detection result */
#detection-output table.widefat {
    border: 1px solid #ddd;
}

#detection-output table.widefat th {
    background: #f5f5f5;
    font-weight: 600;
    padding: 10px;
    text-align: left;
}

#detection-output table.widefat td {
    padding: 10px;
    border-top: 1px solid #ddd;
}