/* Layout matches foto_pasfoto.html & twibbon.html */
.editor-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    margin-bottom: 2rem;
}

.preview-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-area {
    background: #1a1a2e;
    border-radius: var(--radius);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 1rem;
}

.preview-placeholder {
    text-align: center;
    color: #666;
}

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

.preview-placeholder p {
    color: #888;
    margin: 0;
}

#preview-image {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.preview-loading {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    gap: 1rem;
    z-index: 10;
}

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

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

.preview-info {
    background: var(--light);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    justify-content: center;
}

.info-label { color: var(--gray); margin-right: 0.5rem; }
.info-value { font-weight: 600; color: var(--dark); }

.controls-section {
    background: var(--light);
    border-radius: var(--radius);
    padding: 1.5rem;
}

/* Upload Card */
.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: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.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;
}

/* Form Controls */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.position-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: var(--radius);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    font-size: 0.85rem;
}

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

.color-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.color-option {
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.2s;
}

.color-option:hover { transform: scale(1.1); }
.color-option input { display: none; }
.color-preview {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.color-option input:checked + .color-preview {
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary);
}

.action-buttons .btn { width: 100%; }

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