:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --secondary-gradient: linear-gradient(135deg, #f43f5e 0%, #fb923c 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-color: #f8fafc;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Top Controls (Version + Language) */
.top-controls {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.lang-switcher {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.lang-btn {
    padding: 10px 22px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-btn:hover {
    color: var(--text-main);
    background: rgba(99, 102, 241, 0.08);
}

.lang-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.3);
}





body {
    font-family: 'Noto Sans KR', 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Animated Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #eef2ff 0%, #f1f5f9 100%);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #c7d2fe;
    top: -100px;
    right: -100px;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: #fbcfe8;
    bottom: -50px;
    left: -50px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #bae6fd;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes move {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

/* App Container */
.app-container {
    position: relative;
    width: 90%;
    max-width: 800px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 100px 40px 40px 40px;
    /* Top padding increased to accommodate lang-switcher */
    box-shadow: var(--shadow);
    margin: 40px 0;
    animation: fadeIn 0.8s ease-out;
}

.version-tag {
    font-size: 0.725rem;
    color: var(--text-muted);
    opacity: 0.5;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    pointer-events: none;
    letter-spacing: 0.02em;
    padding-right: 4px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.live-clock {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    letter-spacing: 0.02em;
}

.system-notice {
    background: #fffbeb;
    color: #92400e;
    padding: 18px 32px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 10px; /* 공지 박스를 아래로 조금 내려 균형을 맞춤 */
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #fde68a;
    box-shadow: 0 2px 10px rgba(146, 64, 14, 0.08);
    line-height: 1.5;
    text-align: center;
}

.mobile-break {
    display: none;
}

@media (max-width: 640px) {
    .mobile-break {
        display: block;
    }
}

header {
    margin-top: 30px;
    /* 여유 공간을 더 확보하기 위해 조금 더 내림 */
    margin-bottom: 30px;
    text-align: center;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #6366f1;
    letter-spacing: -0.02em;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-email {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.text-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.text-btn:hover {
    color: #f43f5e;
    background: rgba(244, 63, 94, 0.05);
}

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 15px; /* 제목 아래 간격을 줄여 내용을 상향 조정 */
    text-align: center;
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 15px; /* 입력 섹션 내부 간격 축소 */
}

textarea {
    width: 100%;
    min-height: 220px;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.5);
    font-family: inherit;
    font-size: 1.1rem;
    resize: vertical;
    transition: all 0.3s ease;
    outline: none;
}

textarea:focus {
    background: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
    border-color: #c7d2fe;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

button {
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.primary-btn {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: white;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.secondary-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

#voice-btn.recording {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #ef4444;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Response Section */
.response-section {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #475569;
}

.response-box {
    background: rgba(241, 245, 249, 0.8);
    border-radius: 16px;
    padding: 16px 20px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    color: #475569;
    font-size: 1.05rem;
    position: relative;
    white-space: pre-wrap;
    word-break: break-word;
}

#response-content {
    margin: 0;
}

.response-box.loading::after {
    content: attr(data-loading-text);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 500;
    color: #6366f1;
}

footer {
    margin-top: 40px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* History Section */
.history-section {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 2px dashed rgba(99, 102, 241, 0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px; /* 개수 표시를 위해 간격 축소 */
}

.history-count {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    font-weight: 500;
    text-align: left;
}

#total-diary-count {
    color: #6366f1;
    font-weight: 700;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s;
}

.icon-btn:hover {
    background: rgba(99, 102, 241, 0.1);
}

.icon-btn.spinning {
    animation: spin 1s linear infinite;
    pointer-events: none;
    opacity: 0.7;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.history-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.history-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.history-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.delete-history-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.delete-history-btn:hover {
    background: #fff5f5;
    /* 캡처 이미지와 동일한 연한 레드 배경 */
    color: #ef4444;
    /* 캡처 이미지와 동일한 레드 아이콘 */
    opacity: 1;
}

.card-diary {
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 20px;
    padding-left: 12px;
    border-left: 3px solid #e2e8f0;
}

.card-ai {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    font-size: 1rem;
    color: #475569;
}

.card-ai-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #6366f1;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.empty-msg {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

/* Auth Screen */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 800px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 120px 30px 60px 30px;
    /* Top padding increased to accommodate lang-switcher */
    box-shadow: var(--shadow);
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.auth-form {
    text-align: left;
    margin: 0 auto 24px auto;
    max-width: 500px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    margin-left: 4px;
}

.input-group input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: white;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.input-group input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.auth-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 24px auto;
    max-width: 500px;
}

.auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(0, 0, 0, 0.05);
}

.auth-divider span {
    position: relative;
    background: #fdfdfd;
    padding: 0 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.google-btn {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    background: white;
    color: #475569;
    border: 1px solid #e2e8f0;
    justify-content: center;
    font-weight: 500;
}

.google-btn img {
    width: 18px;
    height: 18px;
}

.google-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Responsive */
@media (max-width: 1024px) {
    body {
        align-items: flex-start;
        display: block;
    }

    .auth-container {
        padding: 0;
        width: 100%;
        min-height: 100vh;
        display: block;
    }

    .app-container,
    .auth-card {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        border-radius: 0 !important;
        /* 꽉 찬 화면을 위해 모서리 곡률 제거 */
        padding: 120px 20px 60px 20px; /* 세로 패딩을 데스크탑(120/60)과 동일하게 맞춤 */
        border: none !important;
        box-shadow: none !important;
        min-height: 100vh;
    }

    .top-controls {
        top: 20px;
        right: 20px;
        gap: 8px;
    }

    .lang-switcher {
        padding: 6px;
        gap: 8px;
    }

    .lang-btn {
        padding: 8px 16px;
        font-size: 0.95rem;
    }

    .version-tag {
        opacity: 0.6;
        font-size: 0.75rem;
        font-weight: 600;
        padding-right: 4px;
    }

    .system-notice {
        padding: 15px 20px;
        font-size: 1.0rem;
        margin-top: 10px; /* 데스크탑과 동일하게 조정 */
        margin-bottom: 40px; /* 데스크탑과 동일하게 조정 */
    }

    .auth-form {
        max-width: none !important;
        /* 좁게 보이지 않도록 함 */
        margin: 0 auto 30px auto;
    }

    .google-btn {
        max-width: none !important;
    }

    header {
        margin-top: -10px !important;
        /* 상단 여백을 줄여 제목과 더 밀착 */
        margin-bottom: 20px !important;
        /* 하단 여백도 소폭 조절 */
    }

    .header-content {
        flex-direction: column;
        gap: 4px;
        /* 간격을 12px에서 4px로 좁힘 */
        align-items: flex-end;
        /* 우측 정렬 */
    }

    .user-info {
        justify-content: flex-end;
        /* 우측 정렬 */
        width: 100%;
        gap: 12px;
    }

    .user-email {
        word-break: break-all;
        text-align: right;
        /* 우측 정렬 */
        font-size: 0.85rem;
    }

    .logo {
        width: 100%;
        text-align: center;
        margin-top: 15px;
        /* 제목 박스를 아래로 조금 내려 균형을 맞춤 */
        margin-bottom: 0px;
        /* 아래 간격을 없앰 */
    }

    .auth-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    h1 {
        font-size: 2.0rem;
        margin-bottom: 15px; /* 모바일에서도 제목 아래 간격 축소 */
    }

    .auth-subtitle {
        font-size: 0.9rem;
        margin-bottom: 30px; /* 데스크탑과 동일하게 30px로 변경 */
    }

    .input-group {
        margin-bottom: 20px; /* 데스크탑과 동일하게 20px로 변경 */
    }

    .input-group label {
        margin-bottom: 6px;
        font-size: 0.9rem;
    }

    .input-group input {
        padding: 14px 18px;
        font-size: 1rem;
    }

    .auth-divider {
        margin: 24px auto; /* 데스크탑과 동일하게 24px로 변경 */
    }

    /* 히스토리 카드 상단 헤더 최적화 */
    .card-header {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        margin-bottom: 15px !important;
    }

    .card-date {
        font-size: 0.9rem !important;
        color: var(--text-muted) !important;
        font-weight: 500 !important;
        white-space: nowrap;
    }

    .delete-history-btn {
        padding: 0 !important;
        margin: 0 !important;
        width: 28px !important;
        height: 28px !important;
        border-radius: 6px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        background: transparent;
        /* !important 제거하여 호버 배경 허용 */
        border: none !important;
        cursor: pointer;
        transition: all 0.2s;
    }

    .delete-history-btn:hover {
        background: #fff5f5 !important;
        color: #ef4444 !important;
        opacity: 1 !important;
    }

    .delete-history-btn svg {
        width: 14px !important;
        height: 14px !important;
    }

    .button-group {
        flex-direction: column;
    }

    button:not(.icon-btn):not(.icon-btn-large):not(.page-btn):not(.lang-btn):not(.text-btn):not(.icon-only) {
        width: 100%;
        justify-content: center;
    }

    .icon-btn, .icon-btn-large, .icon-only {
        width: 48px !important;
        height: 48px !important;
        padding: 0 !important;
        flex-shrink: 0;
    }

    .icon-btn {
        width: 40px !important;
        height: 40px !important;
    }

    .history-header h2 {
        font-size: 1.2rem;
        margin-bottom: 0;
        white-space: nowrap;
    }

    .history-header {
        gap: 10px;
        justify-content: space-between;
        margin-bottom: 25px;
    }
}

/* Chat Section */
.chat-section {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 2px dashed rgba(99, 102, 241, 0.1);
}

.chat-header-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.profile-img-container {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-img-container:hover {
    transform: scale(1.05);
}

.profile-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
}

.profile-img-container:hover .img-overlay {
    opacity: 1;
}

.text-btn.mini {
    font-size: 0.85rem;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 20px;
}

.online-users-container {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 10px 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.online-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.online-users-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.user-badge {
    background: white;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.mini-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #22c55e;
    /* 초록색 테두리로 온라인 표시 */
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    margin-bottom: 12px;
}

.chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.me .message-wrapper {
    align-items: flex-end;
}

.message-content-area {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.me .message-header {
    flex-direction: row-reverse;
}

.chat-image {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 12px;
    margin-top: 8px;
    display: block;
    cursor: zoom-in;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 3px solid white;
    transition: transform 0.3s;
    object-fit: contain;
}

.chat-image:hover {
    transform: scale(1.02);
}

.chat-messages {
    background: white;
    border-radius: 20px;
    padding: 24px;
    height: 350px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.chat-input-area {
    display: flex;
    gap: 10px;
    align-items: center;
}

#chat-input {
    flex: 1;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: white;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.icon-btn-large {
    background: #f0f4ff;
    /* 연한 파스텔 블루/인디고 배경 */
    border: 1.5px solid #c7d2fe;
    /* 테두리 강조 */
    border-radius: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.icon-btn-large:hover {
    background: #e0e7ff;
    transform: translateY(-2px) scale(1.05);
    border-color: #818cf8;
}

.primary-btn.icon-only {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    border-radius: 12px;
}

#chat-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.chat-message {
    padding: 10px 16px;
    border-radius: 14px;
    max-width: 80%;
    font-size: 0.95rem;
    line-height: 1.4;
}

.chat-message.me {
    align-self: flex-end;
    background: var(--primary-gradient);
    color: white;
    border-bottom-right-radius: 2px;
}

.chat-message.others {
    align-self: flex-start;
    background: #f1f5f9;
    color: var(--text-main);
    border-bottom-left-radius: 2px;
}

.me .message-content-area {
    align-items: flex-end;
}

.chat-sender {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
}

.chat-message.me .chat-sender {
    color: rgba(255, 255, 255, 0.8);
    text-align: right;
}

.chat-message.others .chat-sender {
    color: var(--text-muted);
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.page-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: white;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.page-btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--indigo-600);
}

.page-btn.active {
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f1f5f9;
}

.page-nav-btn {
    padding: 0 16px;
    width: auto;
    font-size: 0.85rem;
}