/* Image Cropper - Specific Styles */

/* Cropper Interface */
.cropper-interface {
    background: var(--surface);
    border: 1px solid #1f2937;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

/* Cropper Controls */
.cropper-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #1f2937;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-label {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.control-select,
.control-input {
    padding: 10px 12px;
    border: 1px solid #1f2937;
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.control-select:focus,
.control-input:focus {
    outline: none;
    border-color: var(--accent2);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.control-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #1f2937;
    outline: none;
    -webkit-appearance: none;
    margin-top: 8px;
}

.control-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent2);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

.control-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent2);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

.control-color {
    width: 100%;
    height: 40px;
    border: 1px solid #1f2937;
    border-radius: 6px;
    background: var(--bg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-color:hover {
    border-color: var(--accent2);
}

/* Cropper Container */
.cropper-container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    margin-bottom: 24px;
}

.image-container {
    background: var(--bg);
    border: 1px solid #1f2937;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

#cropperImage {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

/* Cropper Tools */
.cropper-tools {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.tool-btn {
    width: 50px;
    height: 50px;
    border: 1px solid #1f2937;
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.tool-btn:hover {
    background: var(--accent2);
    color: white;
    border-color: var(--accent2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.tool-btn:active {
    transform: translateY(0);
}

.tool-btn.active {
    background: var(--accent2);
    color: white;
    border-color: var(--accent2);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.action-btn {
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--accent1), var(--accent2));
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,.35);
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border: 1px solid #1f2937;
}

.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent2);
    transform: translateY(-2px);
}

/* Cropper.js Customization */
.cropper-container {
    font-family: inherit;
}

.cropper-view-box,
.cropper-face {
    border-radius: 0;
}

.cropper-line,
.cropper-point {
    background-color: var(--accent2);
}

.cropper-bg {
    background-color: rgba(0, 0, 0, 0.5);
}

.cropper-modal {
    background-color: rgba(0, 0, 0, 0.5);
}

.cropper-dashed {
    border-color: var(--accent2);
}

.cropper-view-box {
    outline: 2px solid var(--accent2);
    outline-color: var(--accent2);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .cropper-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .cropper-tools {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .tool-btn {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 768px) {
    .cropper-interface {
        padding: 20px;
    }
    
    .cropper-controls {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .image-container {
        min-height: 300px;
        padding: 16px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .cropper-interface {
        padding: 16px;
    }
    
    .image-container {
        min-height: 250px;
        padding: 12px;
    }
    
    .tool-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .cropper-tools {
        gap: 8px;
    }
}

/* Loading States */
.cropper-interface.loading {
    opacity: 0.7;
    pointer-events: none;
}

.cropper-interface.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent2);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.cropper-interface.error {
    border-color: #ef4444;
}

.cropper-interface.error .image-container {
    border-color: #ef4444;
}

/* Success States */
.cropper-interface.success {
    border-color: #22c55e;
}

.cropper-interface.success .image-container {
    border-color: #22c55e;
}

/* Hover Effects */
.cropper-interface:hover {
    border-color: var(--accent2);
}

.image-container:hover {
    border-color: var(--accent2);
}

/* Focus States */
.control-select:focus,
.control-input:focus,
.control-color:focus {
    border-color: var(--accent2);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

/* Disabled States */
.control-select:disabled,
.control-input:disabled,
.control-range:disabled,
.control-color:disabled,
.tool-btn:disabled,
.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.fade-out {
    animation: fadeOut 0.3s ease-out;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

.slide-down {
    animation: slideDown 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
