/**
 * Styles for Extraction Viewer Component
 */

.extraction-viewer {
    background: #2a2a2a;
    border: 2px solid #ff00ff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    color: #ff00ff;
    font-family: monospace;
}

.extraction-header {
    margin-bottom: 20px;
}

.extraction-header h2 {
    margin: 0 0 15px 0;
    color: #ff00ff;
    text-align: center;
}

.extraction-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    background: #1a1a1a;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #ff00ff;
}

.extraction-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.extraction-content {
    min-height: 400px;
}

.extraction-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: #888;
    text-align: center;
}

.extraction-empty p {
    margin: 10px 0;
}

/* Grid View Styles */
.extractions-list {
    background: #1a1a1a;
    border: 1px solid #ff00ff;
    border-radius: 5px;
    padding: 15px;
    overflow-y: auto;
    max-height: 700px;
}

.extractions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

@media (max-width: 768px) {
    .extractions-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

.extraction-card {
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    contain: layout style;
}

.extraction-card:hover {
    border-color: #ff00ff;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(255, 0, 255, 0.3);
}

.extraction-thumbnail {
    position: relative;
    width: 100%;
    height: 150px;
    overflow: hidden;
    border-radius: 3px;
    margin-bottom: 10px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.extraction-thumbnail img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    content-visibility: auto;
    contain: layout style paint;
}

.extraction-overlay {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 255, 0.9);
    color: #000;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
}

.confidence-badge {
    color: #000;
}

.extraction-info {
    margin-bottom: 10px;
}

.extraction-title {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
    color: #ff00ff;
}

.extraction-details {
    font-size: 11px;
    color: #888;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.extraction-time {
    color: #666;
    font-style: italic;
}

.extraction-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 5px;
}

/* Detail View Styles */
.extraction-detail {
    background: #1a1a1a;
    border: 1px solid #ff00ff;
    border-radius: 5px;
    padding: 20px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ff00ff;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-header h3 {
    margin: 0;
    color: #ff00ff;
}

.detail-nav {
    display: flex;
    gap: 10px;
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .detail-content {
        grid-template-columns: 1fr;
    }
}

.detail-preview, .detail-source {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 15px;
}

.detail-preview h4, .detail-source h4 {
    margin: 0 0 10px 0;
    color: #ff00ff;
    font-size: 14px;
}

.preview-container {
    background: #000;
    border: 2px solid #ff00ff;
    border-radius: 5px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.extracted-preview {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.source-canvas-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    border: 2px solid #ff00ff;
    border-radius: 5px;
    min-height: 400px;
    overflow: auto;
}

#bboxEditorCanvas {
    display: block;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: auto !important;
    position: static;
}

/* Control Styles */
.detail-controls {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 15px;
}

.detail-controls h4 {
    margin: 0 0 15px 0;
    color: #ff00ff;
    font-size: 14px;
}

.bbox-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    font-size: 12px;
    color: #888;
    font-weight: bold;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #1a1a1a;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ff00ff;
    cursor: pointer;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ff00ff;
    cursor: pointer;
    border: none;
}

.control-group input[type="number"] {
    background: #1a1a1a;
    border: 1px solid #444;
    color: #ff00ff;
    padding: 8px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
    width: 100%;
}

.control-group input[type="number"]:focus {
    outline: none;
    border-color: #ff00ff;
}

.detail-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Button Styles */
.btn-icon {
    background: transparent;
    border: 1px solid #ff00ff;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 3px;
    color: #ff00ff;
    font-size: 16px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #ff00ff;
    color: #000;
}

.btn-icon.rotate-ccw-btn:hover,
.btn-icon.rotate-cw-btn:hover {
    background: #00ffff;
    border-color: #00ffff;
    color: #000;
}

.btn-icon.rotate-ccw-btn span,
.btn-icon.rotate-cw-btn span {
    font-size: 18px;
    font-weight: bold;
}

.btn-icon.export-btn:hover {
    background: #00ffff;
    border-color: #00ffff;
    color: #000;
}

.btn-icon.delete-btn:hover {
    background: #ff0000;
    border-color: #ff0000;
    color: #fff;
}

.btn {
    padding: 10px 20px;
    font-family: monospace;
    font-weight: bold;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-primary {
    background: #ff00ff;
    color: #000;
}

.btn-primary:hover {
    background: #cc00cc;
}

.btn-secondary {
    background: #444;
    color: #ff00ff;
    border: 1px solid #ff00ff;
}

.btn-secondary:hover {
    background: #555;
}

.btn-danger {
    background: #ff0000;
    color: #fff;
}

.btn-danger:hover {
    background: #cc0000;
}

.btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-sm {
    padding: 5px 15px;
    font-size: 12px;
}

/* Scrollbar styling */
.extractions-list::-webkit-scrollbar {
    width: 8px;
}

.extractions-list::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.extractions-list::-webkit-scrollbar-thumb {
    background: #ff00ff;
    border-radius: 4px;
}

.extractions-list::-webkit-scrollbar-thumb:hover {
    background: #cc00cc;
}

/* Shared stat styles */
.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-size: 12px;
    color: #888;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #ff00ff;
}

