/**
 * Public/Frontend Styles
 */

/* Avatars */
.mta-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.mta-avatar--placeholder {
    background: #e3f0e9;
}

/* Thread form card */
.mta-thread-form-wrapper {
    max-width: 640px;
    margin: 24px 0;
}

.mta-thread-form-wrapper--feedback {
    margin-top: 36px;
}

.mta-thread-card {
    background: #fff;
    border: 1px solid rgba(16, 136, 80, 0.16);
    border-radius: 10px;
    box-shadow: 0 18px 40px -32px rgba(16, 136, 80, 0.45);
    padding: 24px;
}

.mta-thread-card__header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.mta-thread-card__avatar .mta-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(16, 136, 80, 0.12);
}

.mta-thread-card__meta {
    flex: 1 1 auto;
}

.mta-thread-card__title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #133428;
}

.mta-thread-card__subtitle {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #5d6f66;
}

.mta-form {
    display: flex;
    flex-direction: column;
}

.mta-form-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.mta-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #1f332c;
    font-size: 14px;
}

.mta-form-group label .required {
    color: #d64b3b;
    margin-left: 4px;
}

.mta-form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d2e3db;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: none;
    box-sizing: border-box;
    background: #fcfffd;
}

.mta-form-control:focus,
.mta-form-control:hover {
    outline: none;
    border-color: #d2e3db;
    box-shadow: none;
    background: #fcfffd;
}

.mta-form-control.error {
    border-color: #d64b3b;
    box-shadow: 0 0 0 3px rgba(214, 75, 59, 0.18);
}

textarea.mta-form-control {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

input.mta-form-control {
    padding: 10px 16px;
}

.mta-form .mta-form-control,
.mta-thread-form .mta-form-control {
    border-radius: 10px;
}

.mta-form-message {
    margin: 18px 0 0 0;
    padding: 12px 14px;
    border-radius: 8px;
    display: none;
    font-size: 13px;
    line-height: 1.5;
}

.mta-form-message.success {
    display: block;
    background: #e2f5ec;
    border: 1px solid rgba(16, 136, 80, 0.35);
    color: #0b5f37;
}

.mta-form-message.error {
    display: block;
    background: #fdebea;
    border: 1px solid rgba(214, 75, 59, 0.35);
    color: #a5281a;
}

.mta-form-actions {
    margin-top: 18px;
}

.mta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.mta-btn-primary {
    background: #108850;
    color: #fff;
    box-shadow: 0 8px 20px -12px rgba(16, 136, 80, 0.65);
}

.mta-btn-primary:hover {
    background: #0d6e40;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -12px rgba(16, 136, 80, 0.75);
}

.mta-btn-primary:disabled {
    background: #8dbfaa;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.mta-login-message {
    padding: 22px;
    background: #f2faf5;
    border: 1px dashed rgba(16, 136, 80, 0.4);
    border-radius: 10px;
    text-align: center;
}

.mta-login-message p {
    margin: 0 0 14px 0;
    color: #254136;
    font-size: 14px;
}

/* Thread list */
.mta-qna-list-wrapper {
    margin: 32px 0 16px 0;
}

.mta-thread-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mta-comment {
    list-style: none;
}

.mta-comment__card {
    background: #fff;
    border: 1px solid rgba(16, 136, 80, 0.14);
    border-radius: 10px;
    box-shadow: 0 12px 32px -28px rgba(16, 136, 80, 0.45);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mta-comment__body {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.mta-comment__avatar {
    flex: 0 0 auto;
}

.mta-comment__avatar .mta-avatar {
    width: 42px;
    height: 42px;
}

.mta-comment__content {
    flex: 1 1 auto;
    min-width: 0;
}

.mta-comment__header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.mta-comment__name {
    font-weight: 600;
    color: #103629;
    font-size: 15px;
}

.mta-comment__badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(16, 136, 80, 0.12);
    color: #108850;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mta-comment__badge--response {
    background: rgba(10, 120, 70, 0.18);
}

.mta-comment__title {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
    color: #102c22;
}

.mta-comment__subtitle {
    display: block;
    font-size: 12px;
    color: #5e7168;
    margin-bottom: 6px;
}

.mta-comment__text {
    color: #2f3f38;
    line-height: 1.55;
    font-size: 14px;
}

.mta-comment__text p {
    margin: 0 0 8px 0;
}

.mta-comment__text p:last-child {
    margin-bottom: 0;
}

.mta-comment__footer {
    margin-top: 0;
    padding-top: 8px;
    border-top: 1px solid rgba(16, 136, 80, 0.08);
    font-size: 12px;
    color: #7a8983;
}

.mta-comment--response .mta-comment__card {
    border-color: rgba(16, 136, 80, 0.22);
    background: #f7fbf9;
}

.children {
    list-style: none;
    margin: 18px 0 0 48px;
    padding: 0 0 0 18px;
    position: relative;
}

.children::before {
    content: '';
    position: absolute;
    top: -18px;
    left: -20px;
    width: 48px;
    height: calc(50% + 24px);
    border-left: 2px solid rgba(16, 136, 80, 0.2);
    border-bottom: 2px solid rgba(16, 136, 80, 0.2);
    border-bottom-left-radius: 6px;
}

.children > .mta-comment {
    position: relative;
}

.children > .mta-comment {
    margin-top: 18px;
}

.children > .mta-comment:first-child {
    margin-top: 0;
}

.mta-no-items {
    padding: 30px 18px;
    text-align: center;
    color: #5f7168;
    background: #f4faf6;
    border-radius: 8px;
    border: 1px solid rgba(16, 136, 80, 0.18);
    font-size: 14px;
}

.mta-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .mta-thread-card {
        padding: 18px;
    }

    .mta-thread-card__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .mta-thread-card__avatar .mta-avatar {
        width: 52px;
        height: 52px;
    }

    .mta-thread-list {
        gap: 18px;
    }

    .mta-comment__card {
        padding: 16px;
        gap: 12px;
    }

    .mta-comment__body {
        gap: 12px;
    }

    .mta-comment__footer {
        padding-top: 6px;
    }

    .children {
        margin-left: 32px;
        padding-left: 14px;
        border-left-width: 1px;
    }
}

@media (max-width: 480px) {
    .mta-thread-form-wrapper {
        margin: 24px 0;
    }

    .mta-thread-card {
        padding: 18px;
    }

    .mta-comment__title {
        font-size: 17px;
    }

    .mta-comment__card {
        padding: 16px;
    }

    .mta-comment__badge {
        font-size: 10px;
    }

    .mta-form-control {
        font-size: 13px;
    }

    .mta-btn {
        width: 100%;
    }
}
