/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 25px 30px;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body {
    padding: 30px;
}

.setup-guide {
    margin-bottom: 30px;
}

.setup-guide h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

.setup-steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #4CAF50;
}

.step-number {
    background: #4CAF50;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.step-content p {
    color: #666;
    font-size: 0.9rem;
}

.modal-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Input Styles */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-prefix {
    display: flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.input-with-prefix:focus-within {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.prefix {
    background: #f8f9fa;
    padding: 14px 16px;
    border-right: 2px solid #e0e0e0;
    color: #666;
    font-weight: 500;
    font-size: 14px;
}

.input-with-prefix input {
    flex: 1;
    border: none;
    padding: 14px 16px;
    outline: none;
    font-size: 14px;
    background: transparent;
}

.help-text {
    color: #666;
    font-size: 12px;
    margin-top: 6px;
    display: block;
    line-height: 1.4;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-icon {
    background: transparent;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #f0f0f0;
    color: #333;
}

/* App Layout */
.app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-brand h1 {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-version {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.header-stats {
    display: flex;
    gap: 25px;
    align-items: center;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-value {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 400px;
    grid-template-rows: 1fr auto;
    gap: 20px;
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
    height: calc(100vh - 80px);
}

.editor-section {
    grid-column: 1;
    grid-row: 1;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar {
    grid-column: 2;
    grid-row: 1 / span 2;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-section {
    grid-column: 1;
    grid-row: 2;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Section Headers */
.section-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-actions {
    display: flex;
    gap: 10px;
}

/* Content Metrics */
.content-metrics {
    padding: 15px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 25px;
}

.metric {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.9rem;
}

.metric i {
    color: #4CAF50;
}

/* Keywords Input */
.keywords-input {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background: #fafafa;
}

/* Editor Styles */
.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.editor-toolbar {
    padding: 15px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    background: #f8f9fa;
}

.toolbar-group {
    display: flex;
    gap: 5px;
    padding-right: 15px;
    border-right: 1px solid #e0e0e0;
}

.toolbar-group:last-child {
    border-right: none;
}

.editor-toolbar button {
    background: white;
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    color: #555;
}

.editor-toolbar button:hover {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
    transform: translateY(-1px);
}

.article-editor {
    flex: 1;
    border: none;
    padding: 25px;
    resize: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    background: #fefefe;
}

.article-editor:disabled {
    background: #f8f9fa;
    color: #666;
}

.editor-footer {
    padding: 15px 25px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.editor-stats {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 13px;
}

.auto-save-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4CAF50;
    font-size: 13px;
    font-weight: 500;
}

.auto-save-indicator i {
    font-size: 12px;
}

/* Sidebar Styles */
.sidebar-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}

.score-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    min-width: 70px;
    text-align: center;
}

.score-badge.excellent {
    background: #4CAF50;
    color: white;
}

.score-badge.good {
    background: #FFC107;
    color: #333;
}

.score-badge.poor {
    background: #F44336;
    color: white;
}

.score-badge.empty {
    background: #6c757d;
    color: white;
}

.analysis-results {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    text-align: center;
    padding: 40px 25px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #333;
}

.empty-state p {
    margin-bottom: 25px;
    max-width: 300px;
    line-height: 1.5;
}

/* Score Sections */
.score-section {
    text-align: center;
    margin: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.score-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
}

.score-wheel {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.score-grade {
    margin-top: 10px;
}

.score-grade span:first-child {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
}

.score-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Analysis Summary */
.analysis-summary {
    margin: 0 25px 25px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
}

.analysis-summary h4 {
    margin-bottom: 10px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analysis-summary p {
    opacity: 0.9;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Analysis Sections */
.analysis-sections {
    padding: 0 25px;
}

.analysis-section {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #4CAF50;
    transition: all 0.3s ease;
}

.analysis-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.analysis-section .section-header {
    padding: 0;
    border-bottom: none;
    background: transparent;
    margin-bottom: 12px;
}

.analysis-section h4 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.section-score {
    font-weight: 600;
    font-size: 1rem;
}

.section-score-bar {
    margin-bottom: 15px;
}

.score-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

.section-content {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.section-recommendations {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #FFC107;
}

.section-recommendations h5 {
    margin-bottom: 10px;
    color: #333;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recommendations-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recommendations-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.recommendations-list li:last-child {
    border-bottom: none;
}

.recommendations-list i {
    color: #4CAF50;
    margin-top: 3px;
    flex-shrink: 0;
}

/* Internal Links Section */
.internal-links-section {
    margin: 25px;
    padding: 20px;
    background: #e8f5e8;
    border-radius: 12px;
    border-left: 4px solid #2196F3;
}

.internal-links-section h3 {
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.internal-links-list {
    list-style: none;
}

.internal-links-list li {
    padding: 10px 0;
    border-bottom: 1px solid #d0e8d0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.internal-links-list li:last-child {
    border-bottom: none;
}

.internal-links-list i {
    color: #2196F3;
    margin-top: 3px;
}

/* Recommendations Section */
.recommendations-section {
    margin: 25px;
    padding: 20px;
    background: #fff3e0;
    border-radius: 12px;
    border-left: 4px solid #FF9800;
}

.recommendations-section h3 {
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.recommendation-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.rec-number {
    background: #FF9800;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 2px;
}

.rec-text {
    flex: 1;
    line-height: 1.5;
}

/* Enhanced Chat Styles */
.chat-header-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.chat-status {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-status.online {
    color: #4CAF50;
}

.chat-status.typing {
    color: #FF9800;
}

.chat-status i {
    font-size: 0.6rem;
}

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

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #fafafa;
}

/* Message Styles */
.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: messageSlideIn 0.3s ease-out;
}

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

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.assistant {
    align-self: flex-start;
}

.message.welcome-message {
    max-width: 90%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    margin: 10px 0;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #4CAF50;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.message.user .message-avatar {
    background: #667eea;
}

.message.welcome-message .message-avatar {
    background: rgba(255, 255, 255, 0.2);
}

.message-content {
    background: white;
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    flex: 1;
    border: 1px solid #e0e0e0;
}

.message.user .message-content {
    background: #667eea;
    color: white;
    border: none;
}

.message.welcome-message .message-content {
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 20px;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.expert-badge {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.message-text {
    line-height: 1.6;
    font-size: 14px;
}

.message-text strong {
    color: inherit;
}

.message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.message.user .message-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
}

.message-actions {
    display: flex;
    gap: 5px;
}

.message-action {
    background: transparent;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

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

/* Typing Indicator */
.typing-indicator .message-content {
    background: #667eea;
    color: white;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
    0%, 80%, 100% { 
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

/* Quick Actions */
.quick-actions {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    background: white;
}

.quick-actions-header {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.quick-action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.quick-action {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #555;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: left;
}

.quick-action:hover {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
    transform: translateY(-1px);
}

/* Chat Input Container */
.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.chat-input {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s ease;
    background: white;
}

.chat-input.focused {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.chat-input textarea {
    flex: 1;
    border: none;
    padding: 8px 12px;
    resize: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background: transparent;
    max-height: 120px;
}

.chat-input textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-input-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.send-button {
    padding: 10px;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Chat Tips */
.chat-tips {
    margin-top: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.chat-tips-header {
    padding: 12px 16px;
    background: #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-tips-header h4 {
    font-size: 0.9rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-tips-content {
    padding: 12px 16px;
    display: grid;
    gap: 10px;
}

.tip {
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #4CAF50;
}

.tip strong {
    display: block;
    font-size: 0.85rem;
    color: #333;
    margin-bottom: 2px;
}

.tip span {
    font-size: 0.8rem;
    color: #666;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    color: white;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    text-align: center;
    background: white;
    color: #333;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.spinner-animation {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #4CAF50;
    animation: pulse 2s infinite;
}

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

.loading-spinner h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.loading-spinner p {
    margin-bottom: 25px;
    color: #666;
    line-height: 1.5;
}

.loading-progress {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid #4CAF50;
    animation: toastSlideIn 0.3s ease-out;
    max-width: 350px;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left-color: #4CAF50;
}

.toast-icon {
    font-size: 1.5rem;
    color: #4CAF50;
}

.toast-content h4 {
    margin-bottom: 4px;
    color: #333;
    font-size: 1rem;
}

.toast-content p {
    color: #666;
    font-size: 0.9rem;
}

.toast-close {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
}

/* Code Block Styles */
.code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: 8px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    border: 1px solid #333;
}

.code-block pre {
    margin: 0;
    white-space: pre-wrap;
}

.code-block code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr 350px;
    }
    
    .header-stats {
        gap: 20px;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
        gap: 15px;
    }
    
    .editor-section {
        grid-column: 1;
        grid-row: 1;
        min-height: 500px;
    }
    
    .sidebar {
        grid-column: 1;
        grid-row: 2;
        min-height: 600px;
    }
    
    .chat-section {
        grid-column: 1;
        grid-row: 3;
        min-height: 500px;
    }
    
    .keywords-input {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-wrap: wrap;
    }
    
    .header-stats {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 15px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 0 15px;
        gap: 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-stats {
        order: 0;
        width: auto;
        margin-top: 0;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .section-actions {
        width: 100%;
        justify-content: center;
    }
    
    .message {
        max-width: 95%;
    }
    
    .modal {
        margin: 20px;
    }
    
    .quick-action-buttons {
        grid-template-columns: 1fr;
    }
    
    .content-metrics {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0 10px;
        gap: 12px;
    }
    
    .section-header h2 {
        font-size: 1.1rem;
    }
    
    .editor-toolbar {
        justify-content: center;
        padding: 12px 15px;
    }
    
    .toolbar-group {
        padding-right: 10px;
    }
    
    .chat-input {
        flex-direction: column;
        gap: 10px;
    }
    
    .chat-input-actions {
        align-self: flex-end;
    }
    
    .article-editor {
        padding: 20px;
    }
    
    .analysis-sections,
    .internal-links-section,
    .recommendations-section {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .score-section {
        margin: 15px;
    }
    
    .setup-steps {
        gap: 12px;
    }
    
    .step {
        padding: 12px;
    }
}

/* Print Styles */
@media print {
    .app-header,
    .chat-section,
    .section-actions,
    .editor-toolbar,
    .chat-input-container {
        display: none !important;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: auto;
    }
    
    .editor-section,
    .sidebar {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    body {
        background: white;
    }
}
/* Fix Header Text Visibility */
.app-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-brand h1 {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.app-version {
    background: rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.stat-value {
    color: white !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.stat-label {
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* Ensure button text is visible in header */
.header-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.header-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.5);
}