/* Product Form Styles */

/* Form Tabs */
.form-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--admin-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    background: none;
    border: none;
    padding: 16px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--admin-text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    position: relative;
}

.tab-btn:hover {
    color: var(--admin-text);
}

.tab-btn.active {
    color: var(--admin-primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--admin-primary);
}

.tab-btn i {
    font-size: 16px;
}

/* Form Content */
.form-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 32px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Sections */
.form-section {
    margin-bottom: 48px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--admin-text);
    margin: 0 0 24px 0;
}

/* Form Elements */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--admin-text);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.required {
    color: var(--admin-danger);
}

.form-hint {
    font-size: 13px;
    color: var(--admin-text-light);
    margin-top: 6px;
}

/* Input Groups */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-prefix,
.input-suffix {
    padding: 12px 16px;
    background: var(--admin-bg-light);
    border: 1px solid var(--admin-border);
    font-size: 15px;
    color: var(--admin-text-light);
}

.input-prefix {
    border-right: none;
    border-radius: 8px 0 0 8px;
}

.input-suffix {
    border-left: none;
    border-radius: 0 8px 8px 0;
}

.input-group input {
    border-radius: 0;
    flex: 1;
}

.input-group input:focus {
    z-index: 1;
}

.input-group .input-prefix + input {
    border-left: none;
}

.input-group input + .input-suffix {
    border-left: none;
}

select.input-suffix {
    cursor: pointer;
    background-color: var(--admin-bg-light);
}

/* Checkbox Labels */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 15px;
    color: var(--admin-text);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Checkbox Groups */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 12px;
    background: var(--admin-bg-light);
    border-radius: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-item label {
    font-size: 14px;
    color: var(--admin-text);
    cursor: pointer;
    margin: 0;
}

/* Character Counter */
.char-counter {
    font-size: 12px;
    color: var(--admin-text-light);
    text-align: right;
    margin-top: 4px;
}

/* Image Upload Area */
.image-upload-area {
    margin-bottom: 16px;
}

.upload-dropzone {
    border: 2px dashed var(--admin-border);
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    background: var(--admin-bg-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-dropzone:hover {
    border-color: var(--admin-primary);
    background: rgba(255, 107, 74, 0.05);
}

.upload-dropzone.dragover {
    border-color: var(--admin-primary);
    background: rgba(255, 107, 74, 0.1);
}

.upload-dropzone i {
    font-size: 48px;
    color: var(--admin-text-light);
    margin-bottom: 16px;
}

.upload-dropzone p {
    font-size: 16px;
    color: var(--admin-text);
    margin: 0 0 16px 0;
}

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.image-item {
    position: relative;
    background: var(--admin-bg-light);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: move;
}

.image-item.dragging {
    opacity: 0.5;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
}

.image-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.image-btn.primary {
    background: var(--admin-primary);
}

.image-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.3);
}

.image-progress-bar {
    height: 100%;
    background: var(--admin-primary);
    transition: width 0.3s ease;
}

/* SEO Preview */
.seo-preview {
    margin-top: 32px;
}

.seo-preview h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--admin-text);
    margin: 0 0 16px 0;
}

.preview-box {
    padding: 20px;
    background: var(--admin-bg-light);
    border-radius: 8px;
    font-family: Arial, sans-serif;
}

.preview-title {
    color: #1a0dab;
    font-size: 18px;
    line-height: 1.3;
    margin-bottom: 4px;
    cursor: pointer;
}

.preview-title:hover {
    text-decoration: underline;
}

.preview-url {
    color: #006621;
    font-size: 14px;
    margin-bottom: 4px;
}

.preview-description {
    color: #545454;
    font-size: 13px;
    line-height: 1.5;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--admin-border);
}

.actions-left,
.actions-right {
    display: flex;
    gap: 12px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
}

.loading-content i {
    font-size: 48px;
    color: var(--admin-primary);
    margin-bottom: 16px;
}

.loading-content p {
    font-size: 16px;
    color: var(--admin-text);
    margin: 0;
}

/* Validation States */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: var(--admin-danger);
}

.form-group.error input:focus,
.form-group.error select:focus,
.form-group.error textarea:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.error-message {
    color: var(--admin-danger);
    font-size: 13px;
    margin-top: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .form-tabs {
        margin-bottom: 24px;
    }
    
    .tab-btn {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .form-content {
        padding: 20px;
    }
    
    .form-section h3 {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .upload-dropzone {
        padding: 32px 20px;
    }
    
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .form-actions {
        flex-direction: column;
        gap: 16px;
    }
    
    .actions-left,
    .actions-right {
        width: 100%;
        justify-content: center;
    }
}