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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 40px;
}

/* Header */
.header {
    text-align: center;
    padding: 15px 20px;
    background: white;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.logo {
    max-width: 100%;
    width: 100%;
    height: auto;
    margin-bottom: 0;
}

.header h1 {
    color: #1976D2;
    font-size: 28px;
    font-weight: 600;
}

/* Toolbar Section */
.toolbar-section {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    padding: 8px;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.toolbar-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1976D2;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 100px;
    justify-content: center;
}

.toolbar-button:hover {
    background: #e3f2fd;
    border-color: #1976D2;
    transform: translateY(-2px);
}

.toolbar-button:active {
    transform: translateY(0);
}

.toolbar-button svg {
    flex-shrink: 0;
}

/* About Panel */
.about-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

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

.about-panel-content {
    padding: 20px;
}

.about-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.about-panel-header h2 {
    color: #1976D2;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.close-about-button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-about-button:hover {
    background: #f5f5f5;
    color: #1976D2;
}

.about-panel-body {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.version-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
}

.version-label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.version-number {
    font-size: 28px;
    font-weight: 700;
    color: white;
}

.about-description {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
    margin: 0;
}

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

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

.help-section h3 {
    color: #1976D2;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.help-section p {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
    margin: 0;
}

.tools-button-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tool-item-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1976D2;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.tool-item-button:hover {
    background: #e3f2fd;
    border-color: #1976D2;
    transform: translateX(4px);
}

.tool-item-button:active {
    transform: translateX(2px);
}

.tool-item-button svg {
    flex-shrink: 0;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.backup-button {
    background: #4CAF50;
    color: white;
}

.backup-button:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.restore-button {
    background: #2196F3;
    color: white;
}

.restore-button:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.action-button svg {
    flex-shrink: 0;
}

/* Sample Questions Section */
.sample-questions-section {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.sample-questions-toggle {
    width: 100%;
    padding: 18px 20px;
    background: white;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #1976D2;
    transition: background 0.2s;
}

.sample-questions-toggle:hover {
    background: #f5f5f5;
}

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

.sample-questions-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.sample-questions-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.sample-questions-content.expanded {
    max-height: 2000px;
}

.questions-grid {
    padding: 0 20px 20px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.question-category {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 12px;
}

.category-title {
    font-size: 13px;
    font-weight: 700;
    color: #1976D2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 0;
    margin: 0 0 10px 0;
    border-bottom: 2px solid #e3f2fd;
}

.sample-question {
    padding: 10px 12px;
    margin: 6px 0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid transparent;
}

.sample-question:hover,
.sample-question:active {
    background: #e3f2fd;
    color: #1976D2;
    border-color: #1976D2;
    transform: translateX(3px);
}

/* Offline Notice */
.offline-notice {
    background: #ff9800;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Install Button */
.install-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(76, 175, 80, 0.3);
    margin-bottom: 20px;
}

.install-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.4);
}

.install-button:active {
    transform: translateY(0);
}

.install-button svg {
    width: 24px;
    height: 24px;
}

/* Input Section */
.input-section {
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

#questionInput {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
    margin-bottom: 15px;
}

#questionInput:focus {
    outline: none;
    border-color: #1976D2;
}

#questionInput:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.button-group {
    display: flex;
    gap: 10px;
    width: 100%;
}

.clear-button {
    flex: 1;
    padding: 15px;
    background: #757575;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.clear-button:hover {
    background: #616161;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.clear-button:active {
    transform: translateY(0);
}

.submit-button {
    flex: 2;
    padding: 15px;
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(25, 118, 210, 0.3);
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(25, 118, 210, 0.4);
}

.submit-button:active {
    transform: translateY(0);
}

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

/* Dive Deeper Button */
.dive-deeper-button {
    flex: 2;
    padding: 15px;
    background: linear-gradient(135deg, #7B1FA2 0%, #6A1B9A 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(123, 31, 162, 0.3);
}

.dive-deeper-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(123, 31, 162, 0.4);
}

.dive-deeper-button:active {
    transform: translateY(0);
}

.dive-deeper-button:disabled {
    background: #bdbdbd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Sub-Questions Panel */
.sub-questions-panel {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    padding: 20px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, padding 0.3s ease-in-out;
}

.sub-questions-panel.expanded {
    max-height: 800px;
    opacity: 1;
    padding: 20px;
}

.sub-questions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.sub-questions-header h3 {
    margin: 0;
    color: #7B1FA2;
    font-size: 20px;
}

.close-sub-questions {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s, transform 0.2s;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-sub-questions:hover {
    color: #7B1FA2;
    transform: rotate(90deg);
    background: #f5f5f5;
}

.sub-questions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sub-question-item {
    padding: 15px;
    background: linear-gradient(135deg, #f3e5f5 0%, #ede7f6 100%);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    border-left: 4px solid #7B1FA2;
}

.sub-question-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(123, 31, 162, 0.2);
    background: linear-gradient(135deg, #e1bee7 0%, #d1c4e9 100%);
}

.no-sub-questions {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Loading */
.loading {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 20px;
}

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

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

.loading p {
    color: #666;
    font-size: 16px;
}

/* Answer Section */
.answer-section {
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    outline: none;
}

.answer-section:focus {
    outline: none;
}

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

.answer-section h2 {
    color: #1976D2;
    font-size: 24px;
    margin-bottom: 0;
    font-weight: 600;
    outline: none;
}

.answer-section h2:focus {
    outline: none;
}

.copy-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(25, 118, 210, 0.3);
    min-width: 40px;
    min-height: 40px;
}

.copy-button:hover {
    background: linear-gradient(135deg, #1565C0 0%, #0d47a1 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(25, 118, 210, 0.4);
}

.copy-button:active {
    transform: scale(0.95);
}

.copy-button svg {
    flex-shrink: 0;
}

.answer-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 20px;
}

.answer-content p {
    margin-bottom: 15px;
}

.answer-content h1,
.answer-content h2,
.answer-content h3 {
    color: #1976D2;
    margin-top: 20px;
    margin-bottom: 12px;
    font-weight: 600;
}

.answer-content h1 {
    font-size: 24px;
}

.answer-content h2 {
    font-size: 22px;
}

.answer-content h3 {
    font-size: 20px;
}

.answer-content strong {
    font-weight: 600;
    color: #000;
}

.answer-content em {
    font-style: italic;
}

.answer-content a {
    color: #1976D2;
    text-decoration: none;
    border-bottom: 1px solid #1976D2;
}

.answer-content a:hover {
    color: #1565C0;
    border-bottom-color: #1565C0;
}

.answer-content ul,
.answer-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.answer-content li {
    margin-bottom: 8px;
}

.answer-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #d32f2f;
}

.answer-content pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
}

.answer-content pre code {
    background: none;
    padding: 0;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.answer-content blockquote {
    border-left: 4px solid #1976D2;
    padding-left: 15px;
    margin: 15px 0;
    color: #666;
    font-style: italic;
}

/* Citations Section */
.citations-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #e0e0e0;
}

.citations-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    font-weight: 600;
    color: #1976D2;
}

.citations-toggle:hover {
    background: #e3f2fd;
    border-color: #1976D2;
}

.citations-toggle.active {
    background: #e3f2fd;
    border-color: #1976D2;
}

.citations-toggle-text {
    flex-grow: 1;
    text-align: left;
}

.citations-toggle-icon {
    transition: transform 0.3s;
    flex-shrink: 0;
    margin-left: 10px;
}

.citations-toggle.active .citations-toggle-icon {
    transform: rotate(180deg);
}

.citations-count {
    color: #666;
    font-size: 14px;
    font-weight: 500;
    margin-left: 8px;
}

.citations-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.citations-content.expanded {
    max-height: 2000px;
    transition: max-height 0.5s ease-in;
}

.citations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 0;
}
}

.citation-item {
    padding: 12px 15px;
    background: #f5f5f5;
    border-radius: 10px;
    border-left: 4px solid #1976D2;
    font-size: 14px;
    line-height: 1.6;
}

.citation-author {
    font-weight: 600;
    color: #1976D2;
    margin-bottom: 4px;
}

.citation-title {
    color: #666;
    font-style: italic;
}

.processing-time {
    text-align: right;
    color: #999;
    font-size: 12px;
    margin-top: 15px;
}

/* History Section */
.history-section {
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

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

.history-section h2 {
    color: #1976D2;
    font-size: 24px;
    font-weight: 600;
}

.clear-history-button {
    padding: 8px 16px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.clear-history-button:hover {
    background: #d32f2f;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    padding: 15px;
    background: #f5f5f5;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.history-item:hover {
    background: #e3f2fd;
    transform: translateX(5px);
}

.history-question {
    font-weight: 600;
    color: #1976D2;
    margin-bottom: 8px;
    font-size: 15px;
}

.history-answer {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Dive Deeper History Items */
.dive-deeper-item {
    background: linear-gradient(135deg, #f3e5f5 0%, #ede7f6 100%);
    border-left: 4px solid #7B1FA2;
}

.dive-deeper-item:hover {
    background: linear-gradient(135deg, #e1bee7 0%, #d1c4e9 100%);
    cursor: default;
}

.dive-deeper-item .history-question {
    color: #7B1FA2;
}

.history-sub-questions {
    margin-top: 10px;
}

.history-sub-questions-title {
    font-size: 13px;
    font-weight: 600;
    color: #6A1B9A;
    margin-bottom: 8px;
}

.history-sub-question {
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    border-left: 3px solid #9C27B0;
}

.history-sub-question:hover {
    background: #f3e5f5;
    transform: translateX(5px);
}

.history-sub-question:last-child {
    margin-bottom: 0;
}

.history-empty {
    text-align: center;
    color: #999;
    padding: 30px;
    font-size: 16px;
}

/* Notes Section */
.notes-section {
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

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

.notes-section h2 {
    color: #1976D2;
    font-size: 24px;
    font-weight: 600;
}

.notes-header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.toggle-visibility-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #757575;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-visibility-button:hover {
    background: #616161;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.toggle-visibility-button svg {
    transition: transform 0.2s;
}

.toggle-visibility-button.hidden svg {
    transform: rotate(180deg);
}

.notes-content-wrapper {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    max-height: 10000px;
    opacity: 1;
}

.notes-content-wrapper.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.toggle-notes-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.toggle-notes-button:hover {
    background: linear-gradient(135deg, #45a049 0%, #388e3c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
}

.toggle-notes-button svg {
    transition: transform 0.2s;
}

.toggle-notes-button.active svg {
    transform: rotate(45deg);
}

/* Notes Form */
.notes-form-container {
    margin-bottom: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

#noteTextarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.3s;
    margin-bottom: 12px;
}

#noteTextarea:focus {
    outline: none;
    border-color: #1976D2;
}

.notes-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.word-count {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.word-count.warning {
    color: #ff9800;
}

.word-count.error {
    color: #f44336;
    font-weight: 600;
}

.notes-form-buttons {
    display: flex;
    gap: 10px;
}

.cancel-note-button {
    padding: 10px 20px;
    background: #757575;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.cancel-note-button:hover {
    background: #616161;
}

.save-note-button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.3);
}

.save-note-button:hover {
    background: linear-gradient(135deg, #1565C0 0%, #0d47a1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(25, 118, 210, 0.4);
}

.save-note-button:disabled {
    background: #bdbdbd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Notes Search */
.notes-search-container {
    position: relative;
    margin-bottom: 20px;
}

.notes-search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.notes-search-input:focus {
    outline: none;
    border-color: #1976D2;
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

/* Notes List */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.note-item {
    padding: 15px;
    background: #f5f5f5;
    border-radius: 12px;
    border-left: 4px solid #1976D2;
    transition: background 0.2s, transform 0.2s;
}

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

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

.note-date {
    font-size: 12px;
    color: #999;
    font-weight: 500;
    white-space: nowrap;
}

.note-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.note-action-button {
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.note-action-button:hover {
    background: rgba(0, 0, 0, 0.05);
}

.note-action-button.ask-note {
    color: #4CAF50;
}

.note-action-button.ask-note:hover {
    background: #e8f5e9;
}

.note-action-button.copy-note {
    color: #1976D2;
}

.note-action-button.copy-note:hover {
    background: #e3f2fd;
}

.note-action-button.edit-note {
    color: #ff9800;
}

.note-action-button.edit-note:hover {
    background: #fff3e0;
}

.note-action-button.delete-note {
    color: #f44336;
}

.note-action-button.delete-note:hover {
    background: #ffebee;
}

.note-action-button svg {
    width: 18px;
    height: 18px;
}

.note-content {
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.notes-empty {
    text-align: center;
    color: #999;
    padding: 30px;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    .header {
        padding: 12px 15px;
    }

    .header h1 {
        font-size: 24px;
    }

    .logo {
        max-width: 100%;
    }

    .questions-grid {
        grid-template-columns: 1fr;
        padding: 0 15px 15px 15px;
    }

    .sample-questions-toggle {
        padding: 15px;
        font-size: 15px;
    }

    .answer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .copy-button {
        align-self: flex-end;
        padding: 8px;
        min-width: 36px;
        min-height: 36px;
    }

    .copy-button svg {
        width: 18px;
        height: 18px;
    }

    .answer-section h2,
    .history-section h2 {
        font-size: 20px;
    }

    .citations-toggle {
        padding: 12px 15px;
        font-size: 15px;
    }

    .citations-toggle-icon {
        width: 18px;
        height: 18px;
    }
}

/* PWA Install Prompt */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

