/* --- Wrapper (Matches Stopwatch Theme) --- */
#ir-wrapper {
    font-family: 'Press Start 2P', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    background-color: #111827; /* Gray 900 */
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 2px solid #374151; /* Gray 700 */
    color: white;
    gap: 20px;
    min-height: 400px;
}

.hidden { display: none !important; }

/* --- Upload Zone --- */
.ir-drop-zone {
    width: 100%;
    height: 300px;
    border: 3px dashed #4b5563;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    background-color: #1f2937;
}

.ir-drop-zone:hover, .ir-drop-zone.drag-over {
    border-color: #3b82f6; /* Blue */
    background-color: #1e3a8a; /* Dark Blue tint */
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.ir-drop-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.ir-drop-text {
    font-family: 'Press Start 2P', monospace, sans-serif;
    color: #9ca3af;
    font-size: 0.9rem;
    text-align: center;
    padding: 0 20px;
}

/* --- Workspace --- */
.ir-workspace {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Preview Panel --- */
.ir-display-panel {
    background-color: #000;
    border: 4px solid #333;
    border-radius: 8px;
    padding: 10px;
    width: 100%;
    height: 250px; /* Fixed height for preview */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
    overflow: hidden;
    background-image: 
        linear-gradient(45deg, #111 25%, transparent 25%), 
        linear-gradient(-45deg, #111 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #111 75%), 
        linear-gradient(-45deg, transparent 75%, #111 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

#ir-preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.ir-overlay-stats {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    color: #10b981;
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: 0.8rem;
    padding: 8px;
    display: flex;
    justify-content: center;
    gap: 15px;
    border-top: 1px solid #333;
}

/* --- Controls Grid --- */
.ir-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.ir-control-group {
    background-color: #1f2937;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #374151;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ir-label {
    font-size: 0.6rem;
    color: #fbbf24; /* Amber */
    text-transform: uppercase;
    margin-bottom: 5px;
}

.ir-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Inputs */
.ir-input {
    background-color: #111827;
    border: 2px solid #4b5563;
    color: white;
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: 0.9rem;
    padding: 8px;
    border-radius: 4px;
    width: 100%;
    text-align: center;
    outline: none;
}

.ir-input:focus {
    border-color: #3b82f6;
}

.ir-x {
    color: #6b7280;
    font-size: 0.8rem;
}

.ir-select {
    width: 100%;
    background-color: #111827;
    border: 2px solid #4b5563;
    color: white;
    padding: 8px;
    border-radius: 4px;
    font-family: 'Press Start 2P', monospace, sans-serif;
    cursor: pointer;
}

.ir-checkbox {
    font-size: 0.6rem;
    color: #d1d5db;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    margin-top: 5px;
}

/* Range Slider */
.ir-slider-container {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ir-slider-container label {
    font-size: 0.6rem;
    color: #9ca3af;
    display: flex;
    justify-content: space-between;
}

input[type=range] {
    width: 100%;
    height: 6px;
    background: #111827;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
}

/* --- Action Buttons --- */
.ir-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.ir-btn {
    flex: 1;
    padding: 15px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 0 4px 0 rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.ir-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.ir-btn.download {
    background-color: #10b981; /* Green */
    color: #064e3b;
    border-bottom: 4px solid #059669;
}

.ir-btn.reset {
    background-color: #ef4444; /* Red */
    color: #7f1d1d;
    border-bottom: 4px solid #b91c1c;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .ir-controls {
        grid-template-columns: 1fr;
    }
}