/* Form Header Branding Styles */

.form-header-container {
    margin-bottom: 2rem;
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Image-only layout */
.form-header.layout-image-only {
    padding: 0;
}

.form-header.layout-image-only .header-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Text-only layout */
.form-header.layout-text-only {
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.form-header.layout-text-only .header-text {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
}

/* Text above image layout */
.form-header.layout-text-above-image {
    display: flex;
    flex-direction: column;
}

.form-header.layout-text-above-image .header-text-section {
    padding: 1.5rem;
}

.form-header.layout-text-above-image .header-text {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
}

.form-header.layout-text-above-image .header-image-section {
    width: 100%;
}

.form-header.layout-text-above-image .header-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Text below image layout */
.form-header.layout-text-below-image {
    display: flex;
    flex-direction: column;
}

.form-header.layout-text-below-image .header-image-section {
    width: 100%;
}

.form-header.layout-text-below-image .header-image {
    width: 100%;
    height: auto;
    display: block;
}

.form-header.layout-text-below-image .header-text-section {
    padding: 1.5rem;
}

.form-header.layout-text-below-image .header-text {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
}

/* Image left, text right layout */
.form-header.layout-image-left-text-right {
    display: flex;
    flex-direction: row;
}

.form-header.layout-image-left-text-right .header-image-section {
    flex: 1;
    min-width: 0;
}

.form-header.layout-image-left-text-right .header-image {
    width: 100%;
    height: auto;
    display: block;
}

.form-header.layout-image-left-text-right .header-text-section {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-header.layout-image-left-text-right .header-text {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Image alignment utilities */
.header-image.align-left {
    display: block;
    margin-right: auto;
}

.header-image.align-center {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.header-image.align-right {
    display: block;
    margin-left: auto;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .form-header.layout-text-above-image,
    .form-header.layout-text-below-image {
        flex-direction: column;
    }

    .form-header.layout-image-left-text-right {
        flex-direction: column;
    }

    .form-header.layout-image-left-text-right .header-image-section,
    .form-header.layout-image-left-text-right .header-text-section {
        flex: auto;
    }

    .form-header.layout-text-above-image .header-text,
    .form-header.layout-text-below-image .header-text,
    .form-header.layout-image-left-text-right .header-text {
        font-size: 1.25rem;
    }

    .form-header.layout-text-above-image .header-text-section,
    .form-header.layout-text-below-image .header-text-section,
    .form-header.layout-image-left-text-right .header-text-section {
        padding: 1rem;
    }
}

/* Header customization utilities */
.header-text-section {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.header-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 500px;
    display: block;
    object-fit: cover;
}

/* Responsive adjustments for header image */
@media (max-width: 1024px) {
    .header-image {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .header-image {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .header-image {
        max-height: 250px;
    }
}

/* Builder preview styles */
.header-preview {
    border: 2px dashed #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background-color: #f8f9fa;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 0.875rem;
    text-align: center;
}

.header-preview.has-content {
    border-style: solid;
    border-color: #dee2e6;
    background-color: #ffffff;
    color: inherit;
    min-height: auto;
    display: block;
    padding: 0;
}

.header-preview-content {
    width: 100%;
}

.header-thumbnail {
    max-width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 0.375rem;
}

.header-config-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-top: 1rem;
}

.header-config-card label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.header-config-card .form-group {
    margin-bottom: 0.75rem;
}

.header-config-card .form-group:last-child {
    margin-bottom: 0;
}

/* Layout selector buttons */
.layout-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.layout-selector button {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    flex: 1;
    min-width: 120px;
}

.layout-selector button.active {
    box-shadow: inset 0 0 0 3px currentColor;
}

/* Color picker styling */
.color-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-input-group input[type="color"] {
    width: 50px;
    height: 38px;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    cursor: pointer;
}

.color-input-group input[type="text"] {
    flex: 1;
    font-family: monospace;
    font-size: 0.875rem;
}
