/* My Comment Editor AJAX - Styles */

/* CSS Variables for easy theme customization */
:root {
    --mcea-primary-color: #0073aa;
    /* WordPress Blue */
    --mcea-danger-color: #d63638;
    --mcea-border-color: #ddd;
    --mcea-bg-color-light: #f9f9f9;
    --mcea-text-color: #333;
    --mcea-text-color-light: #777;
    --mcea-spacing-unit: 15px;
}

/* --- Edit Form Wrapper & Fields --- */
.mcea-edit-form-wrapper {
    box-sizing: border-box;
    margin: var(--mcea-spacing-unit) 0;
    padding: var(--mcea-spacing-unit);
    background-color: #fff;
    border: 1px solid var(--mcea-border-color);
    border-radius: 4px;
}

.mcea-edit-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--mcea-text-color);
}

.mcea-form-field-group,
.mcea-form-fieldset {
    margin-bottom: var(--mcea-spacing-unit);
}

.mcea-form-textarea,
.mcea-form-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--mcea-border-color);
    border-radius: 3px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.mcea-form-textarea:focus,
.mcea-form-input:focus {
    border-color: var(--mcea-primary-color);
    outline: none;
    box-shadow: 0 0 0 1px var(--mcea-primary-color);
}

/* --- Attachment Section --- */
.mcea-form-fieldset {
    border: 1px solid var(--mcea-border-color);
    padding: var(--mcea-spacing-unit);
    border-radius: 4px;
}

.mcea-form-fieldset legend {
    font-weight: bold;
    padding: 0 8px;
    margin-left: 5px;
    color: var(--mcea-text-color);
}

.mcea-current-attachment-info {
    display: flex;
    align-items: center;
    background-color: var(--mcea-bg-color-light);
    padding: 10px;
    border-radius: 3px;
    margin-bottom: 10px;
    gap: 10px;
    /* 아이템 사이의 간격 */
}

.mcea-file-preview {
    flex-shrink: 0;
}

.mcea-file-thumbnail {
    max-width: 60px;
    max-height: 60px;
    border: 1px solid var(--mcea-border-color);
    border-radius: 3px;
    display: block;
}

.mcea-file-icon {
    font-size: 40px;
    width: 60px;
    height: 60px;
    color: var(--mcea-text-color-light);
    line-height: 60px;
    text-align: center;
}

.mcea-file-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* flex 자식 요소가 부모를 벗어나지 않도록 설정 */
}

.mcea-file-name {
    font-weight: bold;
    font-size: 14px;
    word-break: break-all;
}

.mcea-file-size,
.mcea-form-help-text {
    font-size: 12px;
    color: var(--mcea-text-color-light);
}

.mcea-file-view-link {
    font-size: 12px;
    text-decoration: none;
}

.mcea-form-checkbox-group label {
    font-weight: normal;
    display: flex;
    align-items: center;
}

.mcea-form-checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    flex-shrink: 0;
}

.mcea-new-attachment-group {
    margin-top: var(--mcea-spacing-unit);
}

.mcea-no-attachment {
    color: var(--mcea-text-color-light);
    font-style: italic;
    margin: 0;
}

/* --- Form Actions / Buttons --- */
.mcea-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.mcea-btn {
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    box-sizing: border-box;
}

.mcea-btn-submit {
    background-color: var(--mcea-primary-color);
    color: #fff;
    border-color: var(--mcea-primary-color);
}

.mcea-btn-submit:hover,
.mcea-btn-submit:focus {
    background-color: #005a87;
    border-color: #005a87;
}

.mcea-btn-cancel {
    background-color: #f0f0f0;
    color: var(--mcea-text-color);
    border-color: var(--mcea-border-color);
}

.mcea-btn-cancel:hover,
.mcea-btn-cancel:focus {
    background-color: #e0e0e0;
    border-color: #ccc;
}

/* --- Styles for the initial comment form password field --- */
.comment-form-password.mcea-password-field {
    margin-bottom: var(--mcea-spacing-unit, 15px);
}

.comment-form-password.mcea-password-field label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--mcea-text-color, #333);
}

.comment-form-password.mcea-password-field input[type="password"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--mcea-border-color, #ddd);
    border-radius: 3px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.comment-form-password.mcea-password-field input[type="password"]:focus {
    border-color: var(--mcea-primary-color, #0073aa);
    outline: none;
    box-shadow: 0 0 0 1px var(--mcea-primary-color, #0073aa);
}


/*
 * ===================================================================
 * Mobile Responsive Adjustments (화면 폭 600px 이하)
 * ===================================================================
 */
@media (max-width: 600px) {
    .mcea-edit-form-wrapper {
        padding: 10px;
    }

    /* 첨부파일 정보 영역이 좁은 화면에서 줄바꿈 되도록 설정 */
    .mcea-current-attachment-info {
        flex-wrap: wrap;
    }

    /* 버튼들이 세로로 쌓이도록 변경 */
    .mcea-form-actions {
        flex-direction: column-reverse;
        /* '수정' 버튼이 위로 오도록 */
        gap: 12px;
    }

    /* 버튼 너비를 100%로 설정하여 터치하기 쉽게 만듦 */
    .mcea-form-actions .mcea-btn {
        width: 100%;
        text-align: center;
    }
}