/* O.Convertor 风格的自定义样式 */

/* 亮色主题默认样式 */
body {
    background-color: #ffffff;
}

.secondary-button {
    border: 1px solid #D1D5DB; /* gray-300 */
    color: #374151; /* gray-700 */
    background-color: transparent;
    transition: all 0.3s ease;
}

.secondary-button:hover {
    background-color: #F3F4F6; /* gray-100 */
    border-color: #9CA3AF; /* gray-400 */
}

.secondary-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: transparent;
    border-color: #D1D5DB;
}

.cropper-container-wrapper {
    height: 55vh;
    width: 100%;
    background-color: #F3F4F6; /* gray-100 */
    border-radius: 0.75rem;
    position: relative;
}

#upload-section {
    background-color: #F9FAFB; /* gray-50 */
    border-color: #D1D5DB; /* gray-300 */
}

.checkerboard {
    background-image: linear-gradient(45deg, #e5e7eb 25%, transparent 25%), linear-gradient(-45deg, #e5e7eb 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e5e7eb 75%), linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

/* 暗色主题样式 */
.dark body {
    background-color: #121212;
}

.dark .secondary-button {
    border: 1px solid #4B5563; /* gray-600 */
    color: #D1D5DB; /* gray-300 */
}

.dark .secondary-button:hover {
    background-color: #374151; /* gray-700 */
    border-color: #6B7280; /* gray-500 */
}

.dark .secondary-button:disabled {
    border-color: #4B5563;
}

.dark .cropper-container-wrapper {
    background-color: #1F2937; /* gray-800 */
}

.dark #upload-section {
    background-color: #1F2937; /* gray-800 */
    border-color: #4B5563; /* gray-600 */
}

.dark .checkerboard {
    background-image: linear-gradient(45deg, #374151 25%, transparent 25%), linear-gradient(-45deg, #374151 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #374151 75%), linear-gradient(-45deg, transparent 75%, #374151 75%);
}

/* 通用样式 */
.main-container {
    background-color: transparent;
    box-shadow: none;
}

.gradient-text {
    background-image: linear-gradient(to right, #A855F7, #34D399);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.gradient-button {
    background-image: linear-gradient(to right, #8B5CF6, #10B981);
    transition: all 0.3s ease;
}

.gradient-button:hover {
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
}

.color-source.active-color-source {
    border-color: #A855F7;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.8);
}

#image-to-crop {
    display: block;
    max-width: 100%;
}

.editor-canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#display-canvas, #drawing-canvas {
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    cursor: crosshair;
    touch-action: none;
}

.drag-over {
    border-color: #8B5CF6;
    background-color: rgba(139, 92, 246, 0.1);
}

#toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

#toast.show {
    opacity: 1;
    visibility: visible;
}

.toast-error {
    background-color: #e74c3c;
    color: white;
}

.toast-info {
    background-color: #3498db;
    color: white;
}

.toggle-checkbox:checked {
    right: 0;
    border-color: #8B5CF6;
}

.toggle-checkbox:checked + .toggle-label {
    background-color: #8B5CF6;
}

input[type="file"] {
    display: none;
}

.spinner {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#magnifier {
    position: absolute;
    border: 3px solid #A855F7;
    border-radius: 50%;
    cursor: none;
    width: 120px;
    height: 120px;
    z-index: 1000;
    display: none;
    pointer-events: none;
    background-repeat: no-repeat;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.preview-item-wrapper {
    position: relative;
    cursor: crosshair;
}