/* Face Blur Tool Specific Styles */

.face-detection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.face-bounding-box {
    position: absolute;
    border: 2px solid #4158D0;
    background: rgba(65, 88, 208, 0.1);
    pointer-events: none;
    z-index: 10;
    box-sizing: border-box;
    transition: opacity 0.3s ease;
}

.face-bounding-box div {
    position: absolute;
    top: -25px;
    left: 0;
    background: #4158D0;
    color: white;
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 3px;
    white-space: nowrap;
    font-weight: 500;
}

.detection-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detection-controls .action-btn {
    margin-bottom: 10px;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #4158D0;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-label {
    font-size: 14px;
    color: var(--text-color);
    user-select: none;
}

.blur-control {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 8px;
}

.blur-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.blur-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4158D0;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.blur-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4158D0;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.blur-display {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: #4158D0;
    background: rgba(65, 88, 208, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
}

.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-actions .action-btn {
    flex: 1;
    min-width: 120px;
}

.add-blur-controls .action-btn {
    width: 100%;
    margin-bottom: 10px;
}

.info-item .crop-badge.success {
    background: #10b981;
    color: white;
}

.info-item .crop-badge {
    background: #6b7280;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Loader Styles */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4158D0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.loader-text {
    font-size: 16px;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .detection-controls {
        gap: 8px;
    }

    .toggle-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .blur-control {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .blur-display {
        text-align: center;
    }

    .quick-actions {
        flex-direction: column;
    }

    .quick-actions .action-btn {
        min-width: auto;
    }
}

/* Dark mode support */
[data-theme="dark"] .toggle-slider {
    background-color: #4a5568;
}

[data-theme="dark"] .toggle-label {
    color: #e2e8f0;
}

[data-theme="dark"] .blur-slider {
    background: #4a5568;
}

[data-theme="dark"] .blur-display {
    background: rgba(65, 88, 208, 0.2);
    color: #90cdf4;
}

/* Detection Mode Toggle Styles */
.detection-mode-controls {
    margin: 10px 0;
}

.mode-toggle {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.mode-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: all 0.3s ease;
    flex: 1;
}

.mode-option:hover {
    border-color: #4158D0;
    background: rgba(65, 88, 208, 0.05);
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-option input[type="radio"]:checked + .mode-label {
    color: #4158D0;
    font-weight: 600;
}

.mode-option input[type="radio"]:checked {
    & ~ * {
        border-color: #4158D0;
        background: rgba(65, 88, 208, 0.1);
    }
}

.mode-option:has(input[type="radio"]:checked) {
    border-color: #4158D0;
    background: rgba(65, 88, 208, 0.1);
}

.mode-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    transition: color 0.3s ease;
}

.mode-label i {
    font-size: 16px;
}

/* Blur areas info */
.blur-areas-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 5px;
}

.blur-areas-info .info-label {
    font-size: 14px;
    color: #666;
}

.blur-areas-info .crop-badge {
    background: #6b7280;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.blur-areas-info .crop-badge.success {
    background: #10b981;
}

/* Manual blur area indicator */
.manual-blur-indicator {
    position: absolute;
    border: 2px dashed #ff9800;
    background: rgba(255, 152, 0, 0.1);
    pointer-events: none;
    z-index: 20;
    box-sizing: border-box;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Dark mode support for new elements */
[data-theme="dark"] .mode-option {
    border-color: #4a5568;
    background: #2d3748;
}

[data-theme="dark"] .mode-option:hover {
    border-color: #90cdf4;
    background: rgba(144, 205, 244, 0.1);
}

[data-theme="dark"] .mode-option:has(input[type="radio"]:checked) {
    border-color: #90cdf4;
    background: rgba(144, 205, 244, 0.2);
}

[data-theme="dark"] .mode-label {
    color: #e2e8f0;
}

[data-theme="dark"] .mode-option input[type="radio"]:checked + .mode-label {
    color: #90cdf4;
}

[data-theme="dark"] .blur-areas-info {
    background: #4a5568;
}

[data-theme="dark"] .blur-areas-info .info-label {
    color: #cbd5e0;
}