/* ============================================================
   SUPPORT (CUSTOMER SERVICE) PAGE STYLES
   ============================================================ */

.support-section {
    padding: 0 0 var(--space-xl) 0;
    margin-top: 100px;
    min-height: calc(100vh - 160px);
    display: flex;
    flex-direction: column;
}

/* ---- Step 1: 고객 정보 입력 폼 ---- */
.support-info {
    max-width: 520px;
    margin: 40px auto;
    text-align: center;
    padding: var(--space-3xl) var(--space-2xl) !important;
    animation: fadeIn 0.5s ease-out;
}

.support-info__icon {
    font-size: 3.5rem;
    margin-bottom: var(--space-md);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.support-info__title {
    font-size: var(--fs-h2);
    margin: 0 0 var(--space-md) 0;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.support-info__desc {
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0 0 var(--space-2xl) 0;
    font-size: var(--fs-body);
}

.support-info__fields {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.support-field {
    text-align: left;
}

.support-field__label {
    display: block;
    font-size: var(--fs-small);
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: var(--fw-medium);
}

.support-field__input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--fs-body);
    transition: border-color var(--transition), box-shadow var(--transition);
    box-sizing: border-box;
}

.support-field__input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.support-field__input::placeholder {
    color: var(--text-muted);
}

.support-field__input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.btn--large {
    padding: 16px 48px;
    font-size: var(--fs-body);
    font-weight: var(--fw-bold);
    width: 100%;
}

/* ---- Step 2: 채팅 인터페이스 ---- */
.support-chat {
    display: flex;
    flex-direction: column;
    height: 750px;
    max-height: 80vh;
    padding: 0 !important;
    overflow: hidden;
    animation: fadeIn 0.4s ease-out;
}

.support-chat__header {
    padding: var(--space-md) var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    min-height: 60px;
}

.support-chat__header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.support-chat__header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.support-chat__status-badge {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: var(--fw-bold);
    white-space: nowrap;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.2);
    }

    50% {
        box-shadow: 0 0 12px 2px rgba(34, 197, 94, 0.15);
    }
}

.support-chat__header-icon {
    font-size: 1.5rem;
}

.support-chat__header-title {
    font-size: var(--fs-h3);
    margin: 0;
    color: var(--text-primary);
    white-space: nowrap;
}

.support-chat__header-right {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    justify-content: flex-end;
}

.support-chat__user-badge {
    font-size: var(--fs-small);
    color: var(--text-secondary);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.btn--danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 8px 16px;
    font-size: var(--fs-small);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    font-weight: var(--fw-medium);
}

.btn--danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
}

/* Tips Banner */
.support-chat__tips {
    background: rgba(212, 175, 55, 0.06);
    border-bottom: 1px solid var(--border-subtle);
    padding: 10px var(--space-xl);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.support-chat__tips-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

/* Messages Area */
.support-chat__messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.support-msg {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: msgSlideIn 0.3s ease-out;
}

@keyframes msgSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.support-msg--ai {
    align-self: flex-start;
    align-items: flex-start;
}

.support-msg--user {
    align-self: flex-end;
    align-items: flex-end;
}

.support-msg__sender {
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 4px;
}

.support-msg__bubble {
    padding: 12px 18px;
    border-radius: var(--radius-lg);
    line-height: 1.7;
    font-size: var(--fs-body);
    white-space: pre-wrap;
    width: fit-content;
    word-break: keep-all;
}

.support-msg--ai .support-msg__bubble {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.support-msg--user .support-msg__bubble {
    background: var(--gradient-purple);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.support-typing {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    border-bottom-left-radius: 4px;
}

.support-typing__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingBounce 1.4s ease-in-out infinite;
}

.support-typing__dot:nth-child(2) {
    animation-delay: 0.2s;
}

.support-typing__dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Input Area */
.support-chat__input-area {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: var(--space-md);
    background: rgba(10, 14, 39, 0.5);
}

.support-chat__input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 15px;
    color: var(--text-primary);
    resize: none;
    font-family: inherit;
    font-size: var(--fs-body);
    max-height: 120px;
    transition: border-color var(--transition);
}

.support-chat__input:focus {
    outline: none;
    border-color: var(--gold);
}

/* ---- Step 3: 상담 완료 ---- */
.support-complete {
    max-width: 520px;
    margin: 40px auto;
    text-align: center;
    padding: var(--space-3xl) var(--space-2xl) !important;
    animation: fadeIn 0.5s ease-out;
}

.support-complete__icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
}

.support-complete__title {
    font-size: var(--fs-h3);
    color: var(--text-primary);
    margin: 0 0 var(--space-md) 0;
}

.support-complete__desc {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 var(--space-2xl) 0;
}

.support-complete__actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
}

/* ---- 종료 확인 모달 ---- */
.support-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.support-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
}

.support-modal__content {
    position: relative;
    z-index: 1;
    max-width: 480px;
    width: 90%;
    padding: var(--space-3xl) var(--space-2xl) !important;
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}

.support-modal__icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.support-modal__title {
    font-size: var(--fs-h3);
    color: var(--text-primary);
    margin: 0 0 var(--space-md) 0;
}

.support-modal__text {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 var(--space-xl) 0;
    font-size: var(--fs-body);
}

.support-modal__actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
}

.support-modal__actions .btn {
    min-width: 130px;
    padding: 12px 24px;
}

/* ---- 이메일 발송 중 ---- */
.support-sending {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
}

.support-sending__content {
    text-align: center;
    padding: var(--space-3xl) var(--space-2xl) !important;
    animation: fadeIn 0.3s ease-out;
}

.support-sending__content p {
    color: var(--text-secondary);
    margin: 0;
    font-size: var(--fs-body);
}

/* ---- Spinner (재사용) ---- */
.support-section .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ---- 반응형 ---- */
@media (max-width: 768px) {
    .support-section {
        margin-top: 80px;
    }

    .support-info,
    .support-complete {
        margin: 20px auto;
        padding: var(--space-2xl) var(--space-lg) !important;
    }

    .support-chat {
        height: calc(100vh - 120px);
        max-height: none;
        border-radius: 0;
    }

    .support-chat__header {
        padding: var(--space-sm) var(--space-md);
        flex-wrap: wrap;
        gap: 8px;
    }

    .support-chat__header-title {
        font-size: var(--fs-body);
    }

    .support-chat__messages {
        padding: var(--space-md);
    }

    .support-msg {
        max-width: 92%;
    }

    .support-chat__input-area {
        padding: var(--space-md);
    }

    .support-modal__content {
        width: 95%;
        padding: var(--space-2xl) var(--space-lg) !important;
    }

    .support-complete__actions {
        flex-direction: column;
    }
}