/* Yesterday Mode Styles */

/* Green background for input text area when Y mode is active */
.editable-text-area.yesterday-mode-active {
    background-color: #e8f5e9 !important;
}

/* Yesterday Mode Button */
.input-action-btn.yesterday-btn {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
}

.input-action-btn.yesterday-btn.active {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

/* Yesterday Search Popup - appears when first word is selected */
.yesterday-search-popup {
    position: absolute;
    z-index: 1000;
    background: white;
    border: 2px solid #4caf50;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 120px;
}

.yesterday-search-popup-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.yesterday-search-btn {
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.yesterday-search-btn:hover {
    background: #45a049;
}

.yesterday-search-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.yesterday-popup-close-btn {
    background: transparent;
    border: none;
    color: #666;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.yesterday-popup-close-btn:hover {
    background: #f0f0f0;
}

/* Yesterday Results Panel - appears on the right side */
.yesterday-results-panel {
    position: fixed;
    top: 80px;
    right: 25%;
    width: 400px;
    max-height: calc(100vh - 120px);
    background: white;
    border: 2px solid #4caf50;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Enable dragging */
    cursor: default;
}

.yesterday-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.yesterday-results-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.yesterday-close-btn {
    background: transparent;
    border: none;
    color: #666;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.yesterday-close-btn:hover {
    background: #f0f0f0;
}

.yesterday-results-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Individual result page */
.yesterday-result-page {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e1e5e9;
}

.yesterday-result-page:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.yesterday-result-page-header {
    font-size: 10px;
    color: #6c757d;
    margin-bottom: 4px;
    font-weight: normal;
}

.yesterday-result-item {
    background: #f8f9fa;
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 4px;
}

.yesterday-result-item:last-child {
    margin-bottom: 0;
}

.yesterday-result-item-type {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 6px;
}

.yesterday-result-item-text {
    color: #333;
    font-size: 13px;
    word-wrap: break-word;
    line-height: 1.4;
    background: #e6f7f1; /* Very light waterish green */
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 4px;
}

/* Analysis HTML content styling (matches popup-updates-container) */
.yesterday-result-item-text.analysis-html-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

/* Style common analysis HTML elements */
.yesterday-result-item-text.analysis-html-content h1,
.yesterday-result-item-text.analysis-html-content h2,
.yesterday-result-item-text.analysis-html-content h3,
.yesterday-result-item-text.analysis-html-content h4 {
    margin: 8px 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
}

.yesterday-result-item-text.analysis-html-content p {
    margin: 4px 0;
    font-size: 14px;
    line-height: 1.4;
}

.yesterday-result-item-text.analysis-html-content ul,
.yesterday-result-item-text.analysis-html-content ol {
    margin: 4px 0;
    padding-left: 20px;
    font-size: 14px;
}

.yesterday-result-item-text.analysis-html-content li {
    margin: 2px 0;
}

.yesterday-result-item-text.analysis-html-content strong,
.yesterday-result-item-text.analysis-html-content b {
    color: #495057;
    font-weight: 600;
}

.yesterday-result-item-text.analysis-html-content::-webkit-scrollbar {
    width: 6px;
}

.yesterday-result-item-text.analysis-html-content::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 2px;
}

.yesterday-result-item-lang {
    font-size: 10px;
    color: #6c757d;
    margin-top: 4px;
    line-height: 1.3;
}

.yesterday-result-item-mp3 {
    margin-top: 8px;
}

.yesterday-audio-player {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.yesterday-audio-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.yesterday-audio-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    background: #4caf50;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.yesterday-audio-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

.yesterday-audio-btn:active {
    transform: scale(0.95);
}

.yesterday-stop-btn {
    background: #dc3545;
}

.yesterday-stop-btn:hover {
    background: #c82333;
}

.yesterday-audio-status {
    font-size: 11px;
    color: #6c757d;
    font-style: italic;
}

.yesterday-results-loading {
    padding: 12px;
    text-align: center;
    color: #666;
    font-size: 14px;
    border-top: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.yesterday-results-empty {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.yesterday-results-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.yesterday-results-empty-text {
    font-size: 14px;
}

/* Scrollbar styling for results panel */
.yesterday-results-content::-webkit-scrollbar {
    width: 8px;
}

.yesterday-results-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.yesterday-results-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.yesterday-results-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Highlight for search words */
.yesterday-highlight {
    background-color: #ffeb3b;
    color: #333;
    padding: 2px 0;
    font-weight: 600;
}


/* Yesterday Improve button styles */
.yesterday-result-item-lang-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.yesterday-improve-btn {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.yesterday-improve-btn:hover {
    background-color: #dcfce7;
    border-color: #86efac;
}

/* RTL for Yesterday Improve */
.rtl-content .yesterday-result-item-lang-container {
    flex-direction: row-reverse;
}
