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

/* Header - Soft modern style */
.header {
    background: linear-gradient(180deg,
            #faf8f4 0%,
            var(--parchment) 100%);
    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: 55px;
    width: auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: drop-shadow(3px 3px 0 rgba(92, 64, 51, 0.3));
}

.logo-text {
    font-size: 28px;
    font-weight: 900;
    color: #5c4033;
    text-shadow: 2px 2px 0 #f5e6d3, -2px -2px 0 #f5e6d3,
        2px -2px 0 #f5e6d3, -2px 2px 0 #f5e6d3,
        3px 3px 0 rgba(0, 0, 0, 0.15);
    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: linear-gradient(180deg,
            #fff8f0 0%,
            var(--parchment) 100%);
    border: none;
    border-radius: 0;
    color: var(--brown-dark);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.1s ease;
    box-shadow: 4px 4px 0 rgba(92, 64, 51, 0.4);
    position: relative;
    clip-path: var(--pixel-corners);
}

.user-info::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid var(--brown-dark);
    clip-path: var(--pixel-corners);
    pointer-events: none;
}

.user-info:hover {
    background: linear-gradient(180deg, #ffffff 0%, #fff8f0 100%);
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 rgba(92, 64, 51, 0.4);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 0;
    border: 3px solid var(--brown-dark);
    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;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}

.login-button {
    padding: 0.6rem 1.25rem;
    background: linear-gradient(180deg,
            var(--orange-light) 0%,
            var(--orange) 100%);
    color: white;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 4px 4px 0 rgba(92, 64, 51, 0.4);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    clip-path: var(--pixel-corners);
}

.login-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid var(--brown-dark);
    clip-path: var(--pixel-corners);
    pointer-events: none;
}

.login-button:hover {
    background: linear-gradient(180deg,
            #ffab5c 0%,
            var(--orange-light) 100%);
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 rgba(92, 64, 51, 0.4);
}

.login-button:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

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

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: linear-gradient(180deg,
            #fff8f0 0%,
            var(--parchment) 100%);
    min-width: 220px;
    border: 4px solid var(--brown-dark);
    border-radius: 0;
    z-index: 1200;
    overflow: hidden;
    margin-top: 0.75rem;
    box-shadow: 6px 6px 0 rgba(92, 64, 51, 0.4);
}

.dropdown-content.show {
    display: block;
    animation: dropdownShow 0.15s steps(3);
}

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

.sso-option:hover {
    background: linear-gradient(180deg,
            var(--orange-light) 0%,
            var(--orange) 100%);
    color: white;
}

.sso-option:last-child {
    border-top: 3px solid var(--brown-dark);
}

.sso-icon {
    width: 36px;
    height: 36px;
    border-radius: 0;
    border: 3px solid var(--brown-dark);
    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: #fee2e2;
    color: #dc2626;
}

.logout-button:hover {
    background: #dc2626;
    color: white;
}

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

.language-button {
    padding: 0.6rem 1.25rem;
    background: linear-gradient(180deg,
            var(--orange-light) 0%,
            var(--orange) 100%);
    color: white;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 4px 4px 0 rgba(92, 64, 51, 0.4);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    clip-path: var(--pixel-corners);
}

.language-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid var(--brown-dark);
    clip-path: var(--pixel-corners);
    pointer-events: none;
}

.language-button:hover {
    background: linear-gradient(180deg,
            #ffab5c 0%,
            var(--orange-light) 100%);
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 rgba(92, 64, 51, 0.4);
}

.language-button:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

.language-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: linear-gradient(180deg,
            #fff8f0 0%,
            var(--parchment) 100%);
    min-width: 180px;
    border: 4px solid var(--brown-dark);
    border-radius: 0;
    z-index: 1200;
    margin-top: 0.75rem;
    overflow: hidden;
    box-shadow: 6px 6px 0 rgba(92, 64, 51, 0.4);
}

.language-dropdown.show {
    display: block;
    animation: dropdownShow 0.15s steps(3);
}

.language-option {
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: all 0.1s 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: 2px solid rgba(92, 64, 51, 0.2);
}

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

.language-option:hover {
    background: linear-gradient(180deg,
            var(--orange-light) 0%,
            var(--orange) 100%);
    color: white;
}

.language-option.active {
    background: linear-gradient(180deg,
            var(--grass-light) 0%,
            var(--grass) 100%);
    color: white;
}

/* Preset buttons (quick actions) */
.preset-button {
    background: linear-gradient(180deg,
            var(--orange-light) 0%,
            var(--orange) 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.1s ease;
    box-shadow: 4px 4px 0 rgba(92, 64, 51, 0.5);
    line-height: 1.4;
    position: relative;
    clip-path: var(--pixel-corners);
}

.preset-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid var(--brown-dark);
    clip-path: var(--pixel-corners);
    pointer-events: none;
}

.preset-button:hover:not(:disabled) {
    background: linear-gradient(180deg,
            #ffab5c 0%,
            var(--orange-light) 100%);
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 rgba(92, 64, 51, 0.5);
}

.preset-button:active:not(:disabled) {
    transform: translate(4px, 4px);
    box-shadow: none;
}

.preset-button:disabled {
    background: linear-gradient(180deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: 4px 4px 0 rgba(92, 64, 51, 0.3);
}

.preset-button:disabled::before {
    border-color: #6b7280;
}

/* 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: 0;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.1s ease;
    box-shadow: 6px 6px 0 rgba(92, 64, 51, 0.5);
    white-space: nowrap;
    text-transform: uppercase;
    clip-path: var(--pixel-corners);
    position: relative;
}

.send-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid var(--brown-dark);
    clip-path: var(--pixel-corners);
    pointer-events: none;
}

.send-button:hover:not(:disabled) {
    background: linear-gradient(180deg,
            #ffab5c 0%,
            var(--orange-light) 100%);
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0 rgba(92, 64, 51, 0.5);
}

.send-button:active:not(:disabled) {
    transform: translate(6px, 6px);
    box-shadow: none;
}

.send-button:disabled {
    background: linear-gradient(180deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 6px 6px 0 rgba(92, 64, 51, 0.3);
}

/* 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: 4px solid var(--brown-dark);
    border-radius: 0;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 6px 6px 0 rgba(92, 64, 51, 0.5);
    text-transform: uppercase;
}

.new-chat-button:hover {
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0 rgba(92, 64, 51, 0.5);
}

.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 {
    background: linear-gradient(180deg,
            var(--brown-dark) 0%,
            #4a3328 100%);
    border-top: 6px solid var(--brown-dark);
    color: var(--parchment);
    padding: 0.5rem 1rem;
    text-align: center;
    margin-top: auto;
    font-size: 0.65rem;
    font-weight: 600;
    position: sticky;
    bottom: 0;
    z-index: 100;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

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