/**
 * Alert Banner Component Styles
 * Based on TinTint Design System
 *
 * 類型：Success / Info / Warning / Error
 * 功能：可關閉、可帶操作按鈕
 *
 * Desktop: padding 16px 24px, button 與 content 並排
 * Mobile:  padding 16px, button 在 content 下方
 */

/* ========================================
   Alert Banner Base
   ======================================== */
.tt-alert {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px;
    gap: 4px;

    width: 100%;
    box-sizing: border-box;

    border-radius: 4px;
    border: 1px solid;

    font-family: 'Noto Sans TC', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 150%;

    /* Animation */
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease;
}

.tt-alert.hiding {
    opacity: 0;
    transform: translateY(-8px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    overflow: hidden;
}

/* ========================================
   Header (icon + title + close)
   ======================================== */
.tt-alert__header {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
}

.tt-alert__header-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

/* Icon */
.tt-alert__icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.tt-alert__icon i {
    font-size: 18px;
}

/* Title */
.tt-alert__title {
    font-weight: 700;
    font-size: 16px;
    line-height: 150%;
    display: flex;
    align-items: center;
    text-transform: capitalize;
    font-feature-settings: 'palt' on;
    flex: 1;
    min-width: 0;
}

/* ========================================
   Body (content + action button)
   ======================================== */
.tt-alert__body {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Content (desc + footer) */
.tt-alert__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

/* Description */
.tt-alert__desc {
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Footer (divider + note) */
.tt-alert__footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
}

.tt-alert__divider {
    width: 100%;
    height: 1px;
    flex-shrink: 0;
}

.tt-alert__note {
    font-size: 12px;
    line-height: 150%;
    width: 100%;
}

/* ========================================
   Action Button
   ======================================== */
.tt-alert__action {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    align-content: center;
    gap: 8px;
    padding: 0;
    white-space: nowrap;
    flex-shrink: 0;

    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;

    font-family: 'Noto Sans TC', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 22px;
    color: #212121;
}

.tt-alert__action:hover {
    text-decoration: underline;
}

.tt-alert__action svg {
    width: 18px;
    height: 18px;
    color: #212121;
}

/* ========================================
   Close Button
   ======================================== */
.tt-alert__close {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 4px;
    width: 24px;
    height: 24px;

    background: transparent;
    border: none;
    border-radius: 4px;

    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.tt-alert__close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.tt-alert__close svg {
    width: 16px;
    height: 16px;
    transition: opacity 0.2s ease;
}

.tt-alert__close:hover svg {
    opacity: 0.8;
}

/* ========================================
   Alert Types - Color Schemes
   ======================================== */

/* Success */
.tt-alert--success {
    background: #EEFAF1;
    border-color: #DDF5E2;
    color: #2A7445;
}

.tt-alert--success .tt-alert__icon { color: #2A7445; }
.tt-alert--success .tt-alert__divider { background: #BAEBC6; }

/* Info */
.tt-alert--info {
    background: #EEF8FB;
    border-color: #DCF0F7;
    color: #22697A;
}

.tt-alert--info .tt-alert__icon { color: #22697A; }
.tt-alert--info .tt-alert__divider { background: #B9E2EF; }

/* Warning */
.tt-alert--warning {
    background: #FFFAEA;
    border-color: #FFF4D5;
    color: #927517;
}

.tt-alert--warning .tt-alert__icon { color: #927517; }
.tt-alert--warning .tt-alert__divider { background: #FFEAAB; }

/* Error */
.tt-alert--error {
    background: #FFEFE8;
    border-color: #FFDED1;
    color: #90341A;
}

.tt-alert--error .tt-alert__icon { color: #90341A; }
.tt-alert--error .tt-alert__divider { background: #FFBDA4; }

/* ========================================
   Responsive - Mobile
   ======================================== */
@media (max-width: 768px) {
    .tt-alert {
        padding: 16px;
    }

    .tt-alert__body {
        flex-direction: column;
        align-items: flex-start;
    }
}
