/* ===== Component Styles - Buttons, Cards, Modals ===== */

/* Header */
.header {
    background: transparent;
    padding: 1.25rem 2rem 1.5rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 1100;
    border-bottom: none;
    box-shadow: none;
}

.header-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.header-logo {
    height: 160px;
    width: auto;
    filter: drop-shadow(0 2px 6px rgba(70, 130, 200, 0.15));
}

.logo-text {
    font-size: 28px;
    font-weight: 900;
    color: var(--brown-dark);
    letter-spacing: 1px;
}

.header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a4b8c;
}

/* Auth section */
.auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #F0F7FF;
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 999px;
    color: var(--orange-dark);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.18s ease;
    position: relative;
}

.user-info:hover {
    background: #E0F0FF;
    border-color: rgba(74, 144, 226, 0.4);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(74, 144, 226, 0.3);
    background: linear-gradient(180deg,
            var(--orange-light) 0%,
            var(--orange) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.login-button {
    padding: 0.6rem 1.25rem;
    background: #F0F7FF;
    color: var(--orange-dark);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 999px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-button:hover {
    background: #E0F0FF;
    border-color: rgba(74, 144, 226, 0.4);
}

.login-button:active {
    background: #d0e8ff;
}

.login-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    min-width: 220px;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    z-index: 1200;
    overflow: hidden;
    margin-top: 0.75rem;
    box-shadow: 0 8px 24px rgba(70, 130, 200, 0.18);
}

.dropdown-content.show {
    display: block;
    animation: dropdownShow 0.15s ease;
}

.sso-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--brown-dark);
    border-radius: 10px;
}

.sso-option:hover {
    background: #F0F7FF;
}

.sso-option:last-child {
    border-top: 1px solid #E2E8F0;
}

.sso-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(74, 144, 226, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
}

.sso-icon.nchu {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    color: white;
}

.logout-button {
    background: #F0F7FF;
    color: var(--orange-dark);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 999px;
    padding: 0.6rem 1.25rem;
}

.logout-button:hover {
    background: #E0F0FF;
    border-color: rgba(74, 144, 226, 0.4);
}

.logout-button .logout-icon {
    flex-shrink: 0;
}

/* User provider label (e.g. NCHU) — muted to fit brand palette */
.user-provider-label {
    font-size: 0.8rem;
    color: var(--brown-light, #64748b);
}

/* Language selector */
.language-selector,
.multilang-link-selector {
    position: relative;
    display: inline-block;
}

.language-button {
    padding: 0.6rem 1.25rem;
    background: #F0F7FF;
    color: var(--orange-dark);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 999px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-button:hover {
    background: #E0F0FF;
    border-color: rgba(74, 144, 226, 0.4);
}

.language-button:active {
    background: #d0e8ff;
}

.language-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    min-width: 180px;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    z-index: 1200;
    margin-top: 0.75rem;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(70, 130, 200, 0.18);
}

.language-dropdown.show {
    display: block;
    animation: dropdownShow 0.15s ease;
}

.language-option {
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: background 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 1rem;
    color: var(--brown-dark);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid #E2E8F0;
    border-radius: 10px;
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: #F0F7FF;
}

.language-option.active {
    background: #E8F4FD;
    color: var(--orange-dark);
}

/* Preset buttons (quick actions) */
.preset-button {
    background: rgba(255, 255, 255, 0.92);
    color: var(--brown-dark);
    border: 1px solid rgba(74, 144, 226, 0.2);
    padding: 0.75rem 1.25rem;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.18s ease;
    box-shadow: 0 2px 8px rgba(70, 130, 200, 0.08);
    line-height: 1.4;
}

.preset-button:hover:not(:disabled) {
    background: #F0F7FF;
    border-color: var(--blue);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.25);
}

.preset-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.preset-button:disabled {
    background: rgba(156, 163, 175, 0.3);
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

/* Send button */
.send-button {
    padding: 1rem 1.5rem;
    background: linear-gradient(180deg, var(--orange-light) 0%, var(--orange) 100%);
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.18s ease;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.35);
    white-space: nowrap;
}

.send-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(74, 144, 226, 0.45);
}

.send-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.send-button:disabled {
    background: #CBD5E0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Stop button */
.stop-button {
    padding: 0.85rem;
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.stop-button:hover {
    background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.45);
}

.stop-button:active {
    transform: translateY(0);
    box-shadow: none;
}

/* New chat button */
.new-chat-button {
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, var(--orange-light) 0%, var(--orange) 100%);
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(74, 144, 226, 0.35);
}

.new-chat-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.45);
}

.load-more-button {
    width: 100%;
    padding: 0.5rem;
    background: linear-gradient(180deg,
            var(--parchment) 0%,
            var(--parchment-dark) 100%);
    color: var(--brown-dark);
    border: 3px solid var(--brown-dark);
    border-radius: 0;
    cursor: pointer;
    font-size: 0.7rem;
    margin-top: 0.5rem;
    transition: all 0.1s ease;
    box-shadow: 4px 4px 0 rgba(92, 64, 51, 0.3);
    font-weight: 600;
}

.load-more-button:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 rgba(92, 64, 51, 0.3);
}

/* Loading animation */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: "";
    animation: dots 1.5s infinite;
}

/* Bottom disclaimer */
.bottom-disclaimer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    margin: 0;
    padding: 0.45rem 1rem;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-top: 1px solid rgba(74, 144, 226, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #64748B;
    font-size: 0.7rem;
    text-align: center;
    box-shadow: 0 -2px 12px rgba(70, 130, 200, 0.06);
}

/* Mobile auth section (hidden by default) */
.mobile-auth-section {
    display: none;
}
