/* ============================================================================
   VILLAGE CALIBRATOR - Style dla panelu kalibracyjnego
   ============================================================================ */

/* Panel główny - prawy górny róg */
.calibration-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 400px;
    max-height: 90vh;
    background: rgba(30, 30, 30, 0.98);
    border: 3px solid #f1c40f;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(241, 196, 15, 0.5), 0 0 50px rgba(0, 0, 0, 0.8);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Header panelu */
.calibration-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    border-bottom: 2px solid #d35400;
}

.calibration-header h3 {
    margin: 0;
    color: #000;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.calibration-close {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #000;
    color: #000;
    font-size: 1.5rem;
    font-weight: bold;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
}

.calibration-close:hover {
    background: #000;
    color: #f1c40f;
    transform: rotate(90deg);
}

/* Lista stref */
.calibration-zones-list {
    padding: 15px;
    border-bottom: 2px solid #444;
    overflow-y: auto;
    max-height: 200px;
}

.calibration-zones-list h4 {
    margin: 0 0 10px 0;
    color: #f1c40f;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.zone-select-btn {
    display: block;
    width: 100%;
    padding: 10px 15px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #555;
    border-radius: 5px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.zone-select-btn:hover {
    background: rgba(241, 196, 15, 0.2);
    border-color: #f1c40f;
    transform: translateX(5px);
}

.zone-select-btn.active {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    border-color: #f39c12;
    color: #000;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.6);
}

/* Kontrolki */
.calibration-controls {
    padding: 15px;
    border-bottom: 2px solid #444;
    overflow-y: auto;
    flex-grow: 1;
}

.calibration-controls h4 {
    margin: 0 0 15px 0;
    color: #f1c40f;
    font-size: 1rem;
    text-transform: uppercase;
    border-bottom: 1px solid #f1c40f;
    padding-bottom: 8px;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    color: #fff;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.control-group label span {
    color: #f1c40f;
    float: right;
    font-size: 1rem;
}

.control-group input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    outline: none;
    margin-bottom: 8px;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    border: 2px solid #d35400;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
    transition: all 0.2s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.8);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    border: 2px solid #d35400;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
    transition: all 0.2s ease;
}

.control-group input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.8);
}

.control-group input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #555;
    border-radius: 5px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.control-group input[type="number"]:focus {
    outline: none;
    border-color: #f1c40f;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.3);
}

/* CSS Output */
.calibration-css-output {
    padding: 15px;
    border-bottom: 2px solid #444;
    background: rgba(0, 0, 0, 0.3);
}

.calibration-css-output h4 {
    margin: 0 0 10px 0;
    color: #f1c40f;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.calibration-css-output pre {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #555;
    border-radius: 5px;
    padding: 12px;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0 0 10px 0;
    max-height: 150px;
    overflow-y: auto;
}

.copy-css-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border: 2px solid #1e8449;
    border-radius: 5px;
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-css-btn:hover {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.5);
    transform: translateY(-2px);
}

/* Instrukcje */
.calibration-instructions {
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
}

.calibration-instructions h4 {
    margin: 0 0 10px 0;
    color: #f1c40f;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.calibration-instructions ul {
    margin: 0;
    padding-left: 20px;
    color: #ccc;
    font-size: 0.8rem;
}

.calibration-instructions li {
    margin-bottom: 6px;
}

.calibration-instructions kbd {
    display: inline-block;
    padding: 2px 6px;
    background: #000;
    border: 1px solid #f1c40f;
    border-radius: 3px;
    color: #f1c40f;
    font-family: monospace;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Highlight dla aktywnej strefy */
.building-zone.calibration-active {
    border: 4px solid #0f0 !important;
    background: rgba(0, 255, 0, 0.3) !important;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.8), inset 0 0 20px rgba(0, 255, 0, 0.5);
    z-index: 10000;
}

.building-zone.calibration-active::after {
    background: rgba(0, 255, 0, 0.9) !important;
    color: #000 !important;
    border: 2px solid #000;
    font-size: 1rem !important;
    padding: 6px 12px !important;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.8);
}

/* Styl podczas przeciągania */
.building-zone.calibration-dragging {
    cursor: move;
    border-color: #ff0 !important;
    background: rgba(255, 255, 0, 0.4) !important;
    box-shadow: 0 0 40px rgba(255, 255, 0, 1);
}

/* Tryb kalibracji - zmiana kursora */
body.calibration-mode .building-zone {
    cursor: grab;
}

body.calibration-mode .building-zone:active {
    cursor: grabbing;
}

/* Responsywność dla mniejszych ekranów */
@media (max-width: 768px) {
    .calibration-panel {
        width: 90%;
        right: 5%;
        top: 10px;
        max-height: 85vh;
    }
}

/* Scrollbar styling dla WebKit */
.calibration-zones-list::-webkit-scrollbar,
.calibration-controls::-webkit-scrollbar,
.calibration-css-output pre::-webkit-scrollbar {
    width: 8px;
}

.calibration-zones-list::-webkit-scrollbar-track,
.calibration-controls::-webkit-scrollbar-track,
.calibration-css-output pre::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.calibration-zones-list::-webkit-scrollbar-thumb,
.calibration-controls::-webkit-scrollbar-thumb,
.calibration-css-output pre::-webkit-scrollbar-thumb {
    background: #f1c40f;
    border-radius: 4px;
}

.calibration-zones-list::-webkit-scrollbar-thumb:hover,
.calibration-controls::-webkit-scrollbar-thumb:hover,
.calibration-css-output pre::-webkit-scrollbar-thumb:hover {
    background: #f39c12;
}
