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

body {
    font-family: "Inter", "Noto Sans KR", sans-serif;
    background: #f2f2f2;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
    padding: 30px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.header-top {
    text-align: center;
}

.header-title {
    text-align: center;
}

.header-title h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.header-subtitle {
    opacity: 0.9;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.header-controls {
    position: absolute;
    bottom: 10px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.font-size-controls {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
    max-width: 93px;
    height: 32px;
}

.font-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.font-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.font-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.font-size-display {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 12px;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.header-toggle-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: none;
}

.header-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

header.collapsed .header-subtitle,
header.collapsed .header-controls {
    opacity: 0;
    max-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

header.collapsed {
    padding: 15px 30px;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 20px 20px 0;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in;
}

.message-content {
    max-width: 80%;
    padding: 15px 20px;
    border-radius: 20px;
    line-height: 1.5;
}

.message-timestamp {
    font-size: 12px;
    margin-top: 8px;
    opacity: 0.7;
}

.user-message .message-timestamp {
    color: rgba(255, 255, 255, 0.8);
}

.bot-message .message-timestamp {
    color: #6c757d;
}

.user-message .message-content {
    background: #007bff;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
    width: fit-content;
    min-width: 50px;
}

.bot-message .message-content {
    background: white;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 5px;
}

.system-message {
    text-align: center;
    margin: 10px 0;
}

.system-message .message-content {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    margin: 0 auto;
    max-width: 90%;
    border-radius: 15px;
    padding: 10px 15px;
    font-size: 14px;
}

.system-message .message-timestamp {
    color: #856404;
    opacity: 0.7;
    font-size: 11px;
}

.feedback-section {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #28a745;
}

.feedback-title {
    font-weight: bold;
    color: #495057;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-list {
    list-style: none;
}

.feedback-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    gap: 10px;
}

.feedback-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.feedback-text {
    flex: 1;
    color: #555555;
    line-height: 1.4;
}

.copy-btn {
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: rgba(108, 117, 125, 0.2);
    border-color: rgba(108, 117, 125, 0.3);
}

.read-btn.inline {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    margin-left: 6px;
    transition: all 0.2s ease;
    opacity: 0.6;
    color: #666;
    vertical-align: baseline;
    line-height: 1;
}

.read-btn.inline:hover {
    opacity: 1;
    transform: scale(1.2);
}

.read-btn.feedback {
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    opacity: 0.7;
    color: #666;
}

.read-btn.feedback:hover {
    opacity: 1;
    background: rgba(108, 117, 125, 0.2);
    transform: scale(1.1);
}

.speech-settings {
    position: relative;
}

.settings-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    height: 32px;
    box-sizing: border-box;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.settings-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px;
    min-width: 120px;
    z-index: 1000;
}

.settings-dropdown.hidden {
    display: none;
}

.setting-group {
    margin-bottom: 10px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.setting-group select {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    color: #333;
}

.setting-group select:focus {
    outline: none;
    border-color: #007bff;
}

.setting-group select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

.speech-tooltip {
    position: fixed;
    background: #333;
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

.correction {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.suggestion {
    background: #d1ecf1;
    border-left-color: #17a2b8;
}

.input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 15px;
    align-items: stretch;
    flex-shrink: 0;
    position: relative;
}

.text-input-wrapper {
    flex: 1;
    position: relative;
}

.voice-btn-mini {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 40px;
    height: 32px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 40%;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
    z-index: 10;
}

.voice-btn-mini:hover {
    background: #218838;
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(40, 167, 69, 0.4);
}

.voice-btn-mini.active {
    background: #dc3545;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
    animation: pulse 1.5s infinite;
}

.voice-btn-mini.active:hover {
    background: #c82333;
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.4);
}

.voice-btn-mini.disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.voice-btn-mini.disabled:hover {
    background: #6c757d;
    transform: none;
    box-shadow: 0 2px 6px rgba(108, 117, 125, 0.3);
}

.voice-icon {
    font-size: 14px;
    line-height: 1;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

#user-input {
    width: 100%;
    padding: 15px 45px 15px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    resize: none;
    font-family: inherit;
    transition: border-color 0.3s ease;
    height: 80px;
    box-sizing: border-box;
}

#user-input:focus {
    outline: none;
    border-color: #8a8a8a;
}

#send-btn {
    padding: 15px 30px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#send-btn:hover {
    background: #0056b3;
}

#send-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.loading {
    padding: 20px;
    text-align: center;
    background: white;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.footer {
    background: #f8f9fa;
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
    font-size: 12px;
    color: #6c757d;
    flex-shrink: 0;
}

.footer a {
    color: #007bff;
    text-decoration: none;
}

/* Help System Styles */
.help-floating-btn {
    position: absolute;
    top: -78px;
    right: 27px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
    z-index: 1100;
    transition: all 0.3s ease;
    animation: helpButtonPulse 2s infinite;
}

.help-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    animation: none;
}

.help-floating-btn:focus {
    outline: 3px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

.help-icon {
    font-size: 28px;
    line-height: 1;
}

@keyframes helpButtonPulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.05);
    }
}

.help-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.help-panel.hidden {
    display: none;
}

.help-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    margin: 0;
    flex-shrink: 0;
    gap: 15px;
}

.help-panel-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    flex: 1;
}

.language-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lang-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.lang-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.25);
    opacity: 1;
    font-weight: 600;
}

.help-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: all 0.2s ease;
}

.help-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.help-close-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

.help-panel > div {
    background: white;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.help-panel-content {
    padding: 25px;
    overflow-y: auto;
    border-radius: 0 0 15px 15px;
    flex: 1;
    min-height: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.help-section {
    margin-bottom: 37px;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h4 {
    color: #3b82f6;
    margin-bottom: 7px;
    font-size: 1.1rem;
    font-weight: 600;
}

.help-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-section li {
    padding: 6px 0 0 15px;
    border-bottom: 1px solid #f3f4f6;
    line-height: 1.5;
}

.help-section li:last-child {
    border-bottom: none;
}

.help-section li strong {
    color: #374151;
    font-weight: 600;
}

.guide-tooltip {
    position: fixed;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 1300;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.guide-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

/* Notes Panel Styles */
.notes-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1200;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notes-panel.open {
    right: 0;
}

.notes-panel-header {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.notes-panel-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.notes-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.notes-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.notes-panel-toolbar {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-shrink: 0;
}

.notes-search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.notes-search {
    width: 100%;
    padding: 8px 30px 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.notes-search:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.notes-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
}

.notes-search:not(:placeholder-shown) + .notes-search-clear {
    display: flex;
}

.notes-search-clear:hover {
    background: rgba(156, 163, 175, 0.2);
}

.notes-toolbar-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.notes-toolbar-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.notes-toolbar-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.notes-categories {
    display: flex;
    background: #f9fafb;
    border-bottom: 1px solid #e5e5e5;
    overflow-x: auto;
    flex-shrink: 0;
}

.notes-category-tab {
    background: none;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.notes-category-tab:hover {
    background: rgba(59, 130, 246, 0.05);
    color: #3b82f6;
}

.notes-category-tab.active {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.notes-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.notes-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.notes-empty-state p:first-child {
    font-size: 18px;
    margin-bottom: 10px;
}

.notes-empty-state p:last-child {
    font-size: 14px;
    line-height: 1.5;
}

.note-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.note-item:hover {
    background: #f9fafb;
}

.note-item.highlight {
    background: #fef3cd;
    border-left: 4px solid #f59e0b;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.note-category {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.note-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.note-item:hover .note-actions {
    opacity: 1;
}

.note-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.note-action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.note-text {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
    word-break: break-word;
}

.note-timestamp {
    font-size: 11px;
    color: #9ca3af;
}

.notes-add-section {
    border-top: 1px solid #e5e5e5;
    padding: 20px;
    background: #fafafa;
    flex-shrink: 0;
}

.notes-add-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notes-add-category {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    outline: none;
    margin-bottom: 0;
}

.notes-add-category:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.notes-add-controls {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.notes-add-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    outline: none;
}

.notes-add-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.notes-add-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.notes-add-btn:hover {
    background: #2563eb;
}

.notes-add-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.notes-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.notes-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Notes Panel */
.notes-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1200;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notes-panel.open {
    right: 0 !important;
}

/* Resize Handle */
.notes-resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, #3b82f6 50%, transparent 100%);
    cursor: col-resize;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.notes-resize-handle:hover {
    opacity: 1;
}

.notes-panel.resizing .notes-resize-handle {
    opacity: 1;
    background: #3b82f6;
}

/* Header Notes Toggle */
.notes-toggle-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 4px 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
}

.notes-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.notes-count-badge {
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    min-width: 18px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.notes-count-badge.show {
    transform: scale(1);
}

/* Simple Note Button Styles */
.add-note-btn {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 6px;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.add-note-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .notes-header-section {
        position: static;
        margin-top: 10px;
        display: flex;
        justify-content: center;
    }
    
    .notes-toggle-btn {
        width: 40px;
        height: 32px;
        min-width: 40px;
        padding: 6px;
    }
    
    .notes-icon {
        font-size: 16px;
    }
    
    .message-actions {
        position: static;
        opacity: 1;
        visibility: visible;
        background: none;
        backdrop-filter: none;
        box-shadow: none;
        padding: 0;
        margin-top: 8px;
        justify-content: flex-end;
    }
    
    .feedback-dropdown-menu {
        left: 0;
        right: auto;
    }
}

/* Mobile Notes Panel */
@media (max-width: 768px) {
    .notes-panel {
        width: 100vw;
        right: -100vw;
    }
    
    .notes-panel.open {
        right: 0;
    }
    
    .notes-panel-toolbar {
        padding: 12px 15px;
    }
    
    .notes-categories {
        overflow-x: auto;
    }
    
    .notes-category-tab {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .notes-add-section {
        padding: 15px;
    }
    
    .notes-add-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .notes-add-btn {
        width: 100%;
        padding: 10px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 10px;
        height: calc(100vh - 20px);
    }
    
    header {
        padding: 20px;
    }
    
    .header-controls {
        position: static;
        margin-top: 10px;
        transition: all 0.3s ease;
        justify-content: center;
    }
    
    .header-title h1 {
        font-size: 1.5rem;
    }
    
    .header-toggle-btn {
        display: block;
    }
    
    header.collapsed {
        padding: 10px 20px;
    }
    
    header.collapsed .header-title h1 {
        font-size: 1.3rem;
        margin-bottom: 0;
    }

    .message-content {
        max-width: 90%;
    }

    .input-container {
        padding: 15px;
        gap: 10px;
    }

    #send-btn {
        max-width: 45px;
        padding: 10px 5px;
        height: 60px;
        font-size: 14px;
        line-height: 14px;
        border-radius: 13px;
    }
    
    .voice-btn-mini {
        width: 35px;
        height: 28px;
        bottom: 8px;
        right: 8px;
        font-size: 12px;
    }
    
    #user-input {
        padding: 12px 40px 12px 12px;
        height: 60px;
    }
    
    /* Mobile help system adjustments */
    .help-floating-btn {
        width: 50px;
        height: 50px;
        top: -64px;
        right: 15px;
        font-size: 20px;
    }
    
    .help-icon {
        font-size: 24px;
    }
    
    .help-panel-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .help-panel-header {
        padding: 15px 20px;
        gap: 10px;
    }
    
    .help-panel-header h3 {
        font-size: 1.1rem;
    }
    
    .language-toggle {
        padding: 2px;
    }
    
    .lang-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .help-panel-content {
        padding: 20px;
    }

    .footer {
        padding: 7px 20px;
    }
}

/* Text Selection Translation Feature Styles */

/* Magnifying glass button for text selection */
.text-selection-magnify {
    position: absolute;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 14px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    animation: fadeInScale 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-selection-magnify:hover {
    background: #2563eb;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.text-selection-magnify:active {
    transform: scale(0.95);
}

/* Translation popup modal */
.translation-popup {
    position: fixed;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 20px;
    min-width: 280px;
    max-width: 400px;
    z-index: 1001;
    animation: popupFadeIn 0.3s ease;
    font-family: "Inter", "Noto Sans KR", sans-serif;
}

.translation-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 10px;
}

.translation-popup-title {
    font-weight: 600;
    color: #374151;
    font-size: 16px;
}

.translation-popup-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.translation-popup-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.translation-content {
    margin-bottom: 15px;
}

.selected-text {
    background: #f3f4f6;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-weight: 500;
    color: #1f2937;
    word-wrap: break-word;
    line-height: 1.4;
    border-left: 3px solid #3b82f6;
}

.translation-result {
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    min-height: 40px;
    display: flex;
    align-items: center;
    color: #374151;
    background: #fafafa;
    word-wrap: break-word;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.translation-loading {
    display: flex;
    align-items: center;
    color: #6b7280;
    font-style: italic;
    gap: 8px;
}

.translation-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

.translation-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.action-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-weight: 500;
    min-height: 36px;
}

.action-btn:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.action-btn:active:not(:disabled) {
    transform: translateY(0);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6;
}

.copy-btn {
    color: #333333;
    border-color: #e0e0e0;
}

.copy-btn:hover:not(:disabled) {
    background: white;
    border-color: #8a8a8a;
}

.speak-btn {
    color: #333333;
    border-color: #e0e0e0;
}

.speak-btn:hover:not(:disabled) {
    background: white;
    border-color: #8a8a8a;
}

/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design for translation popup */
@media (max-width: 480px) {
    .translation-popup {
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
    }
    
    .text-selection-magnify {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .translation-actions {
        flex-direction: column;
        gap: 6px;
    }
    
    .action-btn {
        flex: none;
    }
}

/* Enhanced text selection styling */
.chat-messages::selection,
.chat-messages *::selection {
    background: rgba(59, 130, 246, 0.2);
    color: inherit;
}

.chat-messages::-moz-selection,
.chat-messages *::-moz-selection {
    background: rgba(59, 130, 246, 0.2);
    color: inherit;
}

/* Prevent text selection on UI elements */
.translation-popup-close,
.action-btn,
.text-selection-magnify {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Loading state improvements */
.translation-result.loading {
    background: #f8f9fa;
    border-color: #e9ecef;
}

/* Success state for translation result */
.translation-result.success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

/* Error state for translation result */
.translation-result.error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}