/* ============================================================================
   READING CALIBRATOR - Style dla panelu kalibracyjnego okienka lektury
   ============================================================================ */

/* Panel główny - wyśrodkowany */
.reading-calibration-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    max-height: 90vh;
    background: rgba(30, 30, 30, 0.98);
    border: 3px solid #27ae60;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(39, 174, 96, 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, #2ecc71 0%, #27ae60 100%);
    border-bottom: 2px solid #1e8449;
}

.calibration-header h3 {
    margin: 0;
    color: #fff;
    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 #fff;
    color: #fff;
    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: #fff;
    color: #27ae60;
    transform: rotate(90deg);
}

/* 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: #2ecc71;
    font-size: 1rem;
    text-transform: uppercase;
    border-bottom: 1px solid #2ecc71;
    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: #2ecc71;
    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, #2ecc71 0%, #27ae60 100%);
    border: 2px solid #1e8449;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(46, 204, 113, 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(46, 204, 113, 0.8);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border: 2px solid #1e8449;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(46, 204, 113, 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(46, 204, 113, 0.8);
}

/* 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: #2ecc71;
    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, #3498db 0%, #2980b9 100%);
    border: 2px solid #1e5a8a;
    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, #2980b9 0%, #1e5a8a 100%);
    box-shadow: 0 0 15px rgba(52, 152, 219, 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: #2ecc71;
    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 #2ecc71;
    border-radius: 3px;
    color: #2ecc71;
    font-family: monospace;
    font-size: 0.75rem;
    font-weight: bold;
}

/* ============================================================================
   STYLE OKIENKA LEKTURY (domyślne, można zmienić w kalibratorze)
   ============================================================================ */

.reading-box {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 330px;
    min-height: 40px;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.5), rgba(39, 174, 96, 0.5));
    border: 2px solid #27ae60;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 900;
    font-size: 10px;
}

/* Highlight podczas kalibracji */
.reading-box.calibration-active {
    border: 4px solid #f1c40f !important;
    box-shadow: 0 0 30px rgba(241, 196, 15, 0.8), 0 0 50px rgba(0, 0, 0, 0.8);
    animation: pulse-reading 2s infinite;
}

@keyframes pulse-reading {
    0%, 100% {
        box-shadow: 0 0 30px rgba(241, 196, 15, 0.8), 0 0 50px rgba(0, 0, 0, 0.8);
    }
    50% {
        box-shadow: 0 0 40px rgba(241, 196, 15, 1), 0 0 60px rgba(0, 0, 0, 0.9);
    }
}

/* Responsywność dla mniejszych ekranów */
@media (max-width: 768px) {
    .reading-calibration-panel {
        width: 90%;
        max-height: 85vh;
        /* Pozostaw wyśrodkowanie: top: 50%, left: 50%, transform: translate(-50%, -50%) */
    }
    
    .reading-box {
        width: 90%;
        right: 5%;
        left: 5%;
        font-size: 12px;
    }
}

/* Scrollbar styling dla WebKit */
.calibration-controls::-webkit-scrollbar,
.calibration-css-output pre::-webkit-scrollbar {
    width: 8px;
}

.calibration-controls::-webkit-scrollbar-track,
.calibration-css-output pre::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.calibration-controls::-webkit-scrollbar-thumb,
.calibration-css-output pre::-webkit-scrollbar-thumb {
    background: #2ecc71;
    border-radius: 4px;
}

.calibration-controls::-webkit-scrollbar-thumb:hover,
.calibration-css-output pre::-webkit-scrollbar-thumb:hover {
    background: #27ae60;
}
