/**
 * Profile Fields Styles
 *
 * @package IncuCommunity
 * @since 1.0.0
 */

/* ==========================================================================
   Profile Fields Display
   ========================================================================== */

.incuc-profile-fields-wrapper {
    width: 100%;
}

.incuc-profile-field-group {
    margin-bottom: 24px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.incuc-profile-field-group:last-child {
    margin-bottom: 0;
}

.incuc-profile-field-group-name {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}

.incuc-profile-field-group-description {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #666;
}

.incuc-profile-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.incuc-profile-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.incuc-profile-field:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.incuc-profile-field-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.incuc-profile-field-value {
    font-size: 15px;
    color: #1a1a2e;
    line-height: 1.5;
}

.incuc-profile-field-value a {
    color: #007bff;
    text-decoration: none;
}

.incuc-profile-field-value a:hover {
    text-decoration: underline;
}

/* Horizontal layout */
.incuc-profile-field.incuc-layout-horizontal {
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.incuc-profile-field.incuc-layout-horizontal .incuc-profile-field-label {
    min-width: 150px;
    flex-shrink: 0;
}

/* Inline layout */
.incuc-profile-fields.incuc-layout-inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
}

.incuc-profile-fields.incuc-layout-inline .incuc-profile-field {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    border-bottom: none;
    padding: 0;
}

/* Single field display */
.incuc-profile-field-single {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border-bottom: none;
}

/* ==========================================================================
   Profile Fields Edit Form
   ========================================================================== */

.incuc-edit-profile-fields {
    width: 100%;
    max-width: 800px;
}

.incuc-profile-fields-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.incuc-profile-field-input {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.incuc-profile-field-input label {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a2e;
}

.incuc-profile-field-input .incuc-required {
    color: #dc3545;
    margin-left: 2px;
}

.incuc-profile-field-input input[type="text"],
.incuc-profile-field-input input[type="email"],
.incuc-profile-field-input input[type="url"],
.incuc-profile-field-input input[type="tel"],
.incuc-profile-field-input input[type="number"],
.incuc-profile-field-input input[type="date"],
.incuc-profile-field-input textarea,
.incuc-profile-field-input select {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    line-height: 1.5;
    color: #1a1a2e;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.incuc-profile-field-input input:focus,
.incuc-profile-field-input textarea:focus,
.incuc-profile-field-input select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.incuc-profile-field-input textarea {
    resize: vertical;
    min-height: 100px;
}

.incuc-profile-field-input select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.incuc-profile-field-input select[multiple] {
    background-image: none;
    padding-right: 14px;
    min-height: 120px;
}

.incuc-field-description {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #666;
}

/* Radio and Checkbox groups */
.incuc-radio-group,
.incuc-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.incuc-radio-label,
.incuc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #1a1a2e;
    cursor: pointer;
}

.incuc-radio-label input,
.incuc-checkbox-label input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

/* Form actions */
.incuc-profile-fields-actions {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.incuc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.incuc-btn-primary {
    background: #007bff;
    color: #fff;
}

.incuc-btn-primary:hover {
    background: #0056b3;
}

.incuc-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.incuc-btn-secondary {
    background: #f5f5f5;
    color: #1a1a2e;
}

.incuc-btn-secondary:hover {
    background: #e5e5e5;
}

/* ==========================================================================
   Bricks Element Layouts
   ========================================================================== */

.incuc-profile-fields-element.incuc-layout-horizontal .incuc-profile-field {
    flex-direction: row;
    align-items: center;
}

.incuc-profile-fields-element.incuc-layout-horizontal .incuc-profile-field-label {
    min-width: 150px;
    flex-shrink: 0;
}

.incuc-profile-fields-element.incuc-layout-inline .incuc-profile-fields {
    flex-direction: row;
    flex-wrap: wrap;
}

.incuc-profile-fields-element.incuc-layout-inline .incuc-profile-field {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    border-bottom: none;
    padding: 0;
}

/* Columns */
.incuc-profile-fields-element.incuc-columns-2 .incuc-profile-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.incuc-profile-fields-element.incuc-columns-3 .incuc-profile-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.incuc-profile-fields-element.incuc-columns-4 .incuc-profile-fields {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.incuc-profile-fields-element.incuc-columns-2 .incuc-profile-field,
.incuc-profile-fields-element.incuc-columns-3 .incuc-profile-field,
.incuc-profile-fields-element.incuc-columns-4 .incuc-profile-field {
    border-bottom: none;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 6px;
}

/* ==========================================================================
   Validation States
   ========================================================================== */

.incuc-profile-field-input.has-error input,
.incuc-profile-field-input.has-error textarea,
.incuc-profile-field-input.has-error select {
    border-color: #dc3545;
}

.incuc-profile-field-input.has-error input:focus,
.incuc-profile-field-input.has-error textarea:focus,
.incuc-profile-field-input.has-error select:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.incuc-field-error {
    font-size: 13px;
    color: #dc3545;
    margin-top: 4px;
}

.incuc-profile-field-input.is-valid input,
.incuc-profile-field-input.is-valid textarea,
.incuc-profile-field-input.is-valid select {
    border-color: #28a745;
}

/* ==========================================================================
   Toast Messages
   ========================================================================== */

.incuc-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background: #1a1a2e;
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
}

.incuc-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.incuc-toast.success {
    background: #28a745;
}

.incuc-toast.error {
    background: #dc3545;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.incuc-profile-fields-form.is-saving {
    pointer-events: none;
    opacity: 0.7;
}

.incuc-profile-fields-form.is-saving .incuc-btn-primary {
    position: relative;
    color: transparent;
}

.incuc-profile-fields-form.is-saving .incuc-btn-primary::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .incuc-profile-field-group {
        padding: 16px;
    }

    .incuc-profile-field-group-name {
        font-size: 16px;
    }

    .incuc-profile-fields-element.incuc-columns-2 .incuc-profile-fields,
    .incuc-profile-fields-element.incuc-columns-3 .incuc-profile-fields,
    .incuc-profile-fields-element.incuc-columns-4 .incuc-profile-fields {
        grid-template-columns: 1fr;
    }

    .incuc-profile-field.incuc-layout-horizontal,
    .incuc-profile-fields-element.incuc-layout-horizontal .incuc-profile-field {
        flex-direction: column;
        align-items: flex-start;
    }

    .incuc-profile-field.incuc-layout-horizontal .incuc-profile-field-label,
    .incuc-profile-fields-element.incuc-layout-horizontal .incuc-profile-field-label {
        min-width: auto;
    }

    .incuc-profile-fields.incuc-layout-inline,
    .incuc-profile-fields-element.incuc-layout-inline .incuc-profile-fields {
        flex-direction: column;
    }

    .incuc-profile-fields.incuc-layout-inline .incuc-profile-field,
    .incuc-profile-fields-element.incuc-layout-inline .incuc-profile-field {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .incuc-profile-field-group {
        background: #2a2a3e;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }

    .incuc-profile-field-group-name {
        color: #f0f0f0;
    }

    .incuc-profile-field-group-description {
        color: #aaa;
    }

    .incuc-profile-field-label {
        color: #aaa;
    }

    .incuc-profile-field-value {
        color: #f0f0f0;
    }

    .incuc-profile-field {
        border-bottom-color: #3a3a4e;
    }

    .incuc-profile-field-input label {
        color: #f0f0f0;
    }

    .incuc-profile-field-input input,
    .incuc-profile-field-input textarea,
    .incuc-profile-field-input select {
        background: #3a3a4e;
        border-color: #4a4a5e;
        color: #f0f0f0;
    }

    .incuc-profile-field-input input:focus,
    .incuc-profile-field-input textarea:focus,
    .incuc-profile-field-input select:focus {
        border-color: #007bff;
    }

    .incuc-radio-label,
    .incuc-checkbox-label {
        color: #f0f0f0;
    }

    .incuc-field-description {
        color: #aaa;
    }

    .incuc-profile-fields-actions {
        border-top-color: #3a3a4e;
    }

    .incuc-btn-secondary {
        background: #3a3a4e;
        color: #f0f0f0;
    }

    .incuc-btn-secondary:hover {
        background: #4a4a5e;
    }

    .incuc-profile-fields-element.incuc-columns-2 .incuc-profile-field,
    .incuc-profile-fields-element.incuc-columns-3 .incuc-profile-field,
    .incuc-profile-fields-element.incuc-columns-4 .incuc-profile-field {
        background: #3a3a4e;
    }
}
