/* Image Tools Shared Styles */

/* Layout */
.editor-container, .editor-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .editor-container, .editor-layout { grid-template-columns: 1fr; }
}

/* Preview Section */
.preview-section, .preview-area {
    background: var(--light);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Rotate/Crop Style Preview Header/Footer */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--white);
    border-bottom: 1px solid #e5e7eb;
}

.preview-title { font-weight: 600; }
.preview-info-text { font-size: 0.85rem; color: var(--gray); }

.preview-container {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: repeating-conic-gradient(#e5e5e5 0% 25%, #fff 0% 50%) 50% / 20px 20px;
    position: relative;
    overflow: hidden;
}

.preview-wrapper {
    max-width: 100%;
    max-height: 500px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.preview-wrapper img {
    max-width: 100%;
    display: block;
}

.preview-filename {
    padding: 0.75rem 1rem;
    background: var(--white);
    border-top: 1px solid #e5e7eb;
    font-size: 0.85rem;
    color: var(--gray);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Placeholder */
.preview-placeholder {
    padding: 3rem;
    text-align: center;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Controls Section */
.controls-section, .controls-area {
    background: var(--light);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Upload Card (Shared) */
.upload-card {
    border: 2px dashed #ddd;
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: white;
}

.upload-card:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.upload-card input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-icon { font-size: 2rem; }
.upload-text { color: var(--gray); font-size: 0.9rem; }

.upload-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 20;
}

.upload-preview img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.file-name {
    flex: 1;
    text-align: left;
    font-size: 0.9rem;
    color: var(--dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-btn {
    background: #ef4444;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.remove-btn:hover { background: #dc2626; }

/* Control Groups */
.control-group {
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 1rem;
}

.control-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

/* Grids */
.ratio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.ratio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.ratio-option:hover { border-color: var(--primary); }
.ratio-option input { margin: 0; }
.ratio-option input:checked + .ratio-label { color: var(--primary); font-weight: 600; }

/* Buttons in controls */
.docs-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.btn-group { display: flex; gap: 0.5rem; }
.btn-group .btn { flex: 1; }

.action-buttons .btn { width: 100%; margin-bottom: 0.5rem; }

/* Watermark Specifics */
.position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.position-option {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
}
.position-option:hover { border-color: var(--primary); }
.position-option input { display: none; }
.position-option input:checked + span { color: var(--primary); font-weight: bold; }

.color-options { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.color-option { cursor: pointer; }
.color-preview { width: 30px; height: 30px; border-radius: 50%; display: block; border: 1px solid #ddd; }
.color-option input:checked + .color-preview { box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary); }
