/* Web 1.0 Style CSS for CD Image Cleaner */

body {
    font-family: "Times New Roman", Times, serif;
    background-color: #c0c0c0;
    margin: 0;
    padding: 10px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border: 3px outset #c0c0c0;
    padding: 0;
}

.header {
    background-color: #000080;
    color: #ffff00;
    padding: 15px;
    text-align: center;
    border-bottom: 3px inset #c0c0c0;
}

.header h1 {
    font-size: 24px;
    margin: 0 0 5px 0;
    font-weight: bold;
    color: red;
}

.header p {
    font-size: 14px;
    margin: 0;
}

.main-content {
    padding: 20px;
}

.upload-section {
    margin-bottom: 20px;
}

.upload-area {
    border: 2px dashed #808080;
    padding: 40px 20px;
    text-align: center;
    background: #f0f0f0;
    cursor: pointer;
}

.upload-area.dragover {
    border-color: #000080;
    background: #e0e0e0;
}

.upload-area:hover {
    border-color: #000080;
    background: #e0e0e0;
}

.upload-icon {
    font-size: 32px;
    color: #000080;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 16px;
    color: #000000;
    margin-bottom: 5px;
    font-weight: bold;
}

.upload-subtext {
    color: #000000;
    font-size: 12px;
}

.file-input {
    display: none;
}

.btn {
    background-color: #c0c0c0;
    color: #000000;
    border: 2px outset #c0c0c0;
    padding: 8px 16px;
    font-size: 12px;
    cursor: pointer;
    margin: 5px;
    display: inline-block;
    text-decoration: none;
    font-family: "Times New Roman", Times, serif;
}

.btn:hover {
    background-color: #d0d0d0;
}

.btn:active {
    border: 2px inset #c0c0c0;
}

.btn:disabled {
    background-color: #808080;
    color: #c0c0c0;
    cursor: not-allowed;
    border: 2px inset #808080;
}

.processing-section {
    display: none;
    text-align: center;
    margin: 20px 0;
    border: 2px inset #c0c0c0;
    padding: 20px;
    background-color: #f0f0f0;
}

.spinner {
    border: 3px solid #c0c0c0;
    border-top: 3px solid #000080;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

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

.preview-section {
    display: none;
    margin-top: 40px;
}

.selection-section {
    display: none;
    margin-top: 20px;
}

.selection-container {
    background: #f0f0f0;
    border: 2px inset #c0c0c0;
    padding: 15px;
    text-align: center;
    margin-bottom: 20px;
}

.selection-container h3 {
    margin-bottom: 10px;
    color: #000000;
    font-size: 16px;
    font-weight: bold;
}

.image-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin: 0 auto;
}

.selection-image {
    max-width: 100%;
    max-height: 400px;
    border: 2px inset #c0c0c0;
    display: block;
}

.circle-overlay {
    position: absolute;
    border: 2px solid #ff0000;
    border-radius: 50%;
    cursor: move;
    background: rgba(255, 0, 0, 0.1);
}

.circle-overlay::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24%;
    height: 24%;
    border: 2px solid #0000ff;
    border-radius: 50%;
    background: rgba(0, 0, 255, 0.2);
}

.circle-overlay::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: #000000;
    border-radius: 50%;
}

.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #ffff00;
    border: 1px solid #000000;
    cursor: se-resize;
    right: -6px;
    bottom: -6px;
}

.selection-instructions {
    background: #ffff00;
    color: #000000;
    padding: 10px;
    border: 1px solid #000000;
    margin: 10px 0;
    font-size: 12px;
    line-height: 1.2;
}

.preview-container {
    display: block;
    margin-bottom: 15px;
}

.preview-box {
    background: #f0f0f0;
    border: 2px inset #c0c0c0;
    padding: 10px;
    text-align: center;
    margin-bottom: 15px;
}

.preview-box.cleaned {
    background-color: #e0e0e0;
    background-image: 
        linear-gradient(45deg, #d0d0d0 25%, transparent 25%), 
        linear-gradient(-45deg, #d0d0d0 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #d0d0d0 75%), 
        linear-gradient(-45deg, transparent 75%, #d0d0d0 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
}

.preview-box h3 {
    margin-bottom: 10px;
    color: #000000;
    font-size: 14px;
    font-weight: bold;
}

.preview-image {
    max-width: 100%;
    max-height: 250px;
}

.canvas-container {
    display: none;
}

.error-message {
    background: #ff0000;
    color: #ffffff;
    padding: 10px;
    border: 2px outset #ff0000;
    margin: 10px 0;
    display: none;
    font-weight: bold;
}

.success-message {
    background: #00ff00;
    color: #000000;
    padding: 10px;
    border: 2px outset #00ff00;
    margin: 10px 0;
    display: none;
    font-weight: bold;
}

.final-rotation-controls {
    background: #f0f0f0;
    border: 2px inset #c0c0c0;
    padding: 10px;
    margin: 10px 0;
    text-align: center;
}

.final-rotation-controls h4 {
    margin: 0 0 8px 0;
    color: #000000;
    font-size: 14px;
    font-weight: bold;
}

.final-rotation-buttons {
    text-align: center;
    margin-bottom: 8px;
}

.final-rotation-btn {
    background-color: #c0c0c0;
    color: #000000;
    border: 2px outset #c0c0c0;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    margin: 2px;
    font-family: "Times New Roman", Times, serif;
}

.final-rotation-btn:hover {
    background-color: #d0d0d0;
}

.final-rotation-btn:active {
    border: 2px inset #c0c0c0;
}

.final-rotation-slider-container {
    text-align: center;
    margin-top: 8px;
}

.final-rotation-slider {
    width: 150px;
    margin: 0 5px;
}

.final-rotation-value {
    font-weight: bold;
    color: #000000;
    font-size: 12px;
}

.ocr-section {
    background: #f0f0f0;
    border: 2px inset #c0c0c0;
    padding: 10px;
    margin: 10px 0;
    display: none;
}

.ocr-section h4 {
    margin: 0 0 8px 0;
    color: #000000;
    font-size: 14px;
    font-weight: bold;
}

.ocr-results {
    background: #ffffff;
    border: 1px inset #c0c0c0;
    padding: 8px;
    min-height: 60px;
    font-family: "Courier New", monospace;
    font-size: 12px;
    color: #000000;
    white-space: pre-wrap;
    overflow-y: auto;
    max-height: 150px;
}

.ocr-progress {
    background: #c0c0c0;
    border: 1px inset #c0c0c0;
    padding: 5px;
    text-align: center;
    font-size: 12px;
    margin: 5px 0;
    display: none;
}

.api-key-section {
    background: #f0f0f0;
    border: 2px inset #c0c0c0;
    padding: 10px;
    margin: 10px 0;
}

.api-key-section h4 {
    margin: 0 0 8px 0;
    color: #000000;
    font-size: 14px;
    font-weight: bold;
}

.api-key-input {
    width: calc(100% - 120px);
    padding: 4px;
    font-family: "Courier New", monospace;
    font-size: 12px;
    border: 1px inset #c0c0c0;
    background: #ffffff;
    margin-bottom: 5px;
    display: inline-block;
}

.api-key-section .btn {
    width: 110px;
    margin-left: 5px;
    padding: 4px 8px;
    font-size: 11px;
    vertical-align: top;
}

.api-key-note {
    font-size: 11px;
    color: #000000;
    font-style: italic;
}

@media (max-width: 768px) {
    .main-content {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .selection-image {
        max-height: 300px;
    }
}
