/* CWYT Story Review Interface Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-left {
    flex: 0 0 auto;
}

.header-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.header-user {
    flex: 0 0 auto;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header h1 i {
    margin-right: 0.5rem;
    color: #3498db;
}

.nav-link {
    color: #ecf0f1;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: #34495e;
}

.nav-link.active {
    background-color: #3498db;
    color: white;
    font-weight: 500;
}

/* Role-based navigation hiding */
.nav-link.nav-item-hidden {
    display: none;
}

/* Project context styles */
.user-context {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.project-info {
    font-size: 0.8rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.user-role {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.1rem 0.4rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* User dropdown */
.user-info {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.user-info:hover {
    background-color: #34495e;
}

.user-info i {
    margin-right: 0.5rem;
}

.user-dropdown {
    position: relative;
    margin-left: 0.5rem;
}

.user-dropdown i {
    transition: transform 0.2s;
}

.user-info:hover .user-dropdown i {
    transform: rotate(180deg);
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    color: #333;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    margin-top: 0.5rem;
}

.user-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-item {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
    border-bottom: 1px solid #eee;
}

.user-menu-item:last-child {
    border-bottom: none;
}

.user-menu-item:hover {
    background-color: #f8f9fa;
}

.user-menu-item i {
    margin-right: 0.5rem;
    width: 14px;
}

nav {
    display: flex;
    gap: 0.5rem;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Review Layout - Sidebar Design */
.review-layout {
    position: relative;
    height: calc(100vh - 120px);
    display: flex;
    gap: 1rem;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-section {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

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

.sidebar-section h3 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 0.75rem;
}

.sidebar-section h4 {
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Progress Bar - Compact */
.progress-compact {
    margin-bottom: 1rem;
}

.progress-compact span {
    font-size: 0.9rem;
    color: #6c757d;
    display: block;
    margin-bottom: 0.5rem;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.hidden {
    display: none !important;
}

/* Info Grid - Compact layout */
.info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.info-item label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #6c757d;
    min-width: 60px;
}

.info-item span {
    font-size: 0.8rem;
    color: #495057;
    font-family: 'Consolas', 'Monaco', monospace;
    text-align: right;
    word-break: break-all;
    max-width: 160px;
}

/* Action Buttons - Compact */
.action-buttons-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-buttons-compact .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    justify-content: flex-start;
}

/* Shortcuts Display */
.shortcuts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.shortcut {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.shortcut kbd {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
}

.shortcut-note {
    font-size: 0.7rem;
    color: #6c757d;
    font-style: italic;
    margin-top: 0.5rem;
    text-align: center;
}

/* Debug Info */
.debug-info {
    margin-top: 0.5rem;
}

details summary {
    cursor: pointer;
    font-size: 0.8rem;
    color: #6c757d;
    padding: 0.25rem 0;
}

details[open] summary {
    margin-bottom: 0.5rem;
}

/* Management Buttons */
.management-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Navigation Controls */
.navigation-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-input {
    display: flex;
    gap: 0.5rem;
}

.search-input .btn-search {
    width: 50px !important;
    min-width: unset !important;
    flex-shrink: 0;
}

.input-field {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.8rem;
    outline: none;
}

.input-field:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Date input field styles */
.date-input {
    padding: 0.3rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    font-size: 0.8rem;
    font-family: 'Consolas', 'Monaco', monospace;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 120px;
    max-width: 120px;
    min-width: 120px;
}

.date-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    outline: none;
}

.date-input.valid {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.date-input.invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.date-input:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.date-status {
    font-size: 0.7rem;
    margin-top: 0.2rem;
    min-height: 1rem;
}

.date-status.success {
    color: #28a745;
}

.date-status.error {
    color: #dc3545;
}

/* Adjust info-item for date input */
.info-item.date-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.info-item.date-item label {
    min-width: auto;
}

.quick-nav {
    display: flex;
    gap: 0.5rem;
}

.quick-nav .btn {
    flex: 1;
}

/* Button Variations */
.btn-small {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
}

.btn-half {
    flex: 1;
    min-width: unset !important;
    padding: 0.5rem 0.4rem;
    font-size: 0.85rem;
}

.btn-half.btn-outline {
    border: 1px solid #dee2e6;
}

.btn-group-half {
    display: flex;
    gap: 0.25rem;
    width: 150px;
}

.btn-search {
    width: 50px !important;
    min-width: unset !important;
    padding: 0.4rem 0.2rem;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #2ecc71;
    transform: translateY(-1px);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c0392b;
    transform: translateY(-1px);
}

.btn-info {
    background: #3498db;
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.btn-outline:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.published {
    background: #d1edff;
    color: #0c5460;
}

.status-badge.unpublished {
    background: #fff3cd;
    color: #856404;
}

/* Main Text Area */
.main-text-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.story-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.story-textarea {
    flex: 1;
    border: none;
    outline: none;
    padding: 2rem;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.1rem;
    line-height: 1.8;
    resize: none;
    background: white;
    min-height: 500px;
}

.story-textarea:focus {
    background: #fefefe;
}

/* Word Count Warning - Compact */
.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 0.75rem;
    margin: 0.75rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.warning i {
    margin-right: 0.5rem;
    color: #f39c12;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    min-width: 150px;
    justify-content: center;
}

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

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

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

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #e67e22;
    transform: translateY(-1px);
}

.btn-warning:disabled {
    background: #f8f9fa !important;
    color: #6c757d !important;
    border: 1px solid #dee2e6 !important;
    opacity: 1 !important;
}

/* Status Messages - Compact */
.status-message {
    padding: 0.75rem;
    border-radius: 6px;
    margin: 0.75rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
}

.status-message.success {
    background: #d1edff;
    color: #0c5460;
    border: 1px solid #b8daff;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    text-align: center;
    color: #6c757d;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #3498db;
}

/* No Stories State */
.no-stories {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
}

.completion-message {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.completion-message i {
    font-size: 4rem;
    color: #2ecc71;
    margin-bottom: 1rem;
}

.completion-message h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.completion-message p {
    color: #6c757d;
    margin-bottom: 2rem;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #e74c3c;
    font-size: 1.2rem;
}

.modal-header i {
    margin-right: 0.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin: 0 0 1rem;
    color: #495057;
}

.story-preview {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.warning-text {
    color: #e74c3c !important;
    font-weight: 500;
    margin-top: 1rem !important;
}

.modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    border-top: 1px solid #e9ecef;
}

/* Footer */
.footer {
    background: #34495e;
    color: #ecf0f1;
    padding: 1rem 2rem;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-link {
    color: #ecf0f1;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.footer-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.shortcut {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

kbd {
    background: #2c3e50;
    border: 1px solid #1a252f;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-family: monospace;
    font-size: 0.8rem;
    color: #ecf0f1;
}

/* Version display in footer */
.version-info {
    font-size: 0.8em;
    color: #888;
    margin-left: 1rem;
}

/* Responsive Design */
@media (max-width: 992px) {
    .main-content {
        padding: 1rem;
    }
    
    .review-layout {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
        max-height: none;
    }
    
    .main-text-area {
        order: 1;
        min-height: 400px;
    }
    
    .info-item span {
        max-width: none;
        word-break: normal;
    }
    
    .action-buttons-compact {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .action-buttons-compact .btn {
        flex: 1;
        text-align: center;
        justify-content: center;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .sidebar-section {
        padding: 0.75rem;
    }
    
    /* Make First/Last/First Unpublished buttons appear on same line in stacked layout */
    .navigation-controls {
        gap: 0.5rem;
    }
    
    .navigation-controls .btn-group-half {
        display: inline-flex;
        width: auto;
        margin-right: 0.5rem;
    }
    
    .navigation-controls .btn-group-half .btn-half {
        min-width: 70px;
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* ===== SEARCH INTERFACE STYLES ===== */

.search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.search-header {
    text-align: center;
    margin-bottom: 2rem;
}

.search-input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color, #007bff);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.search-btn:hover {
    background: var(--primary-dark, #0056b3);
}

.search-results {
    margin-top: 2rem;
}

.results-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

/* Story Result Cards */
.story-result {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 1rem;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.story-result:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: #ccc;
}

.story-header {
    padding: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.story-meta {
    flex: 1;
}

.story-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.story-id {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

/* Relevance Scoring Display */
.story-relevance {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.relevance-score {
    font-weight: 600;
    color: #28a745;
    font-size: 0.9rem;
    min-width: 70px;
    text-align: right;
}

.relevance-bar {
    width: 80px;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.relevance-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 50%, #17a2b8 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.story-meta-middle {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.story-date {
    font-weight: 500;
}

.story-filename {
    color: #888;
}

.story-stats {
    color: #666;
}

/* Score Breakdown */
.score-breakdown {
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.score-component {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.score-label {
    font-weight: 500;
    color: #495057;
}

.score-value {
    font-weight: 600;
    color: #007bff;
    min-width: 35px;
}

.score-mini-bar {
    width: 40px;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.score-mini-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.keyword-fill {
    background: #007bff;
}

.semantic-fill {
    background: #28a745;
}

/* Match Explanations */
.match-explanation {
    font-size: 0.75rem;
    color: #666;
    font-style: italic;
    margin-left: 0.5rem;
    display: block;
    margin-top: 0.2rem;
}

/* Search Highlighting */
.search-highlight {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 3px;
    padding: 0 2px;
    font-weight: 600;
    color: #856404;
}

/* Detailed Score Breakdown */
.detailed-score-toggle {
    margin-top: 0.5rem;
    text-align: center;
}

.score-details-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

.score-details-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.detailed-score-breakdown {
    margin-top: 0.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    border-top: 3px solid #007bff;
}

.detailed-score-header {
    margin-bottom: 1rem;
    text-align: center;
}

.detailed-score-header h4 {
    margin: 0 0 0.5rem 0;
    color: #495057;
    font-size: 1rem;
}

.score-explanation {
    margin: 0;
    color: #6c757d;
    font-size: 0.85rem;
    font-style: italic;
}

.detailed-score-lines {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Simple Inline Scoring Lines */
.score-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.4rem 0;
    font-size: 0.85rem;
}

.score-line .score-icon {
    font-size: 1rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.score-line .score-category {
    font-weight: 600;
    color: #495057;
    min-width: 70px;
    flex-shrink: 0;
}

.score-line .score-percentage {
    font-weight: 600;
    color: #007bff;
    min-width: 35px;
    text-align: right;
    flex-shrink: 0;
}

.score-line .progress-bar {
    width: 60px;
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
    margin: 0 0.25rem;
}

.score-line .progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Progress bar color coding based on score ranges */
.score-line .progress-fill.low-score {
    background-color: #dc3545; /* Red for 0-40% */
}

.score-line .progress-fill.medium-score {
    background-color: #fd7e14; /* Orange for 40-70% */
}

.score-line .progress-fill.high-score {
    background-color: #28a745; /* Green for 70%+ */
}

.score-line .score-description {
    font-size: 0.75rem;
    color: #6c757d;
    flex: 1;
}

.story-preview {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-top: 0.5rem;
}

.expand-icon {
    margin-left: 1rem;
    color: #666;
    transition: transform 0.3s ease;
}

.story-result.expanded .expand-icon {
    transform: rotate(180deg);
}

/* Story Content (Expandable) - Only for search results */
.story-result .story-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    border-top: 1px solid #eee;
}

.story-result.expanded .story-content {
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
}

.story-text {
    padding: 1rem;
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Loading and Empty States */
.loading-state, .empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

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

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

.empty-state i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
}

/* ===== MOBILE NAVIGATION STYLES ===== */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.75rem;
    width: 48px;
    height: 48px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.mobile-menu-toggle:hover {
    background-color: #34495e;
}

.hamburger-line {
    width: 24px;
    height: 3px;
    background-color: #ecf0f1;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger Animation */
.mobile-menu-toggle.active .hamburger-line:first-child {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:last-child {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: #2c3e50;
    padding: 4rem 0 2rem 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
}

.mobile-menu-overlay.show .mobile-nav {
    right: 0;
}

/* Mobile Navigation Links */
.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: #ecf0f1;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 56px;
}

.mobile-nav-link:hover {
    background-color: #34495e;
    color: #ffffff;
}

.mobile-nav-link.active {
    background-color: #3498db;
    color: white;
    font-weight: 500;
}

.mobile-nav-link i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* Hide mobile navigation links that shouldn't be shown based on permissions */
.mobile-nav-link.nav-item-hidden {
    display: none;
}

/* Desktop/Mobile Toggle Styles */
@media (min-width: 993px) {
    /* Desktop: Show desktop nav, hide mobile elements */
    .desktop-nav {
        display: flex !important;
    }
    
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .mobile-menu-overlay {
        display: none !important;
    }
}

@media (max-width: 992px) {
    /* Mobile: Show mobile elements, hide desktop nav */
    .desktop-nav {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    /* Adjust header layout for mobile */
    .header {
        padding: 0.75rem 1rem;
    }
    
    .header-left h1 {
        font-size: 1.3rem;
    }
    
    /* Adjust user info for mobile */
    .user-context {
        font-size: 0.85rem;
    }
    
    .user-name {
        font-size: 0.8rem;
    }
    
    .project-info {
        font-size: 0.7rem;
    }
    
    .user-role {
        font-size: 0.6rem;
        padding: 0.1rem 0.3rem;
    }
    
    /* ===== MOBILE FOOTER ===== */
    /* Adjust footer padding for mobile */
    .footer {
        padding: 1rem;
        text-align: center;
    }
    
    /* ===== MOBILE PAGE-SPECIFIC CLEANUP ===== */
    /* Hide keyboard shortcuts in review sidebar - not useful on mobile */
    .shortcuts {
        display: none !important;
    }
}

/* ===== DESKTOP KEYBOARD HINT CONTROL ===== */
/* Desktop only: Hide keyboard hints except on Story Review page */
@media (min-width: 993px) {
    .keyboard-hint {
        display: none;
    }
    
    /* Exception: Show hints when body has story-review-page class */
    body.story-review-page .keyboard-hint,
    body.story-review-page .keyboard-hint strong,
    body.story-review-page .keyboard-hint .shortcut {
        display: inline !important;
    }
}
/* ===== PROJECT SETTINGS REPORT - COLUMN GROUP SHADING ===== */
/* Add visual groupings to make the multi-column table more scannable */

.col-group-info { 
    background-color: #f5f5f5; /* Light gray - Basic project info */
}

.col-group-users { 
    background-color: #e3f2fd; /* Light blue - User counts */
}

.col-group-chatbot { 
    background-color: #ffe4c4; /* Light peach/bisque - Chatbot settings */
}

.col-group-expansions { 
    background-color: #f3e5f5; /* Light purple - Expansion counts */
}

/* Ensure text remains readable with shading */
.col-group-info,
.col-group-users,
.col-group-chatbot,
.col-group-expansions {
    color: #333;
}

/* Override sticky header background to allow column shading to show through */
#project-settings-table thead th.col-group-info,
#project-settings-table thead th.col-group-users,
#project-settings-table thead th.col-group-chatbot,
#project-settings-table thead th.col-group-expansions {
    /* Column shading should be visible on sticky header */
    position: relative;
}

/* Ensure non-shaded sticky header columns have white background */
#project-settings-table thead th {
    background-color: white;
}

/* Column group backgrounds override the white background */
#project-settings-table thead th.col-group-info {
    background-color: #f5f5f5;
}

#project-settings-table thead th.col-group-users {
    background-color: #e3f2fd;
}

#project-settings-table thead th.col-group-chatbot {
    background-color: #ffe4c4;
}

#project-settings-table thead th.col-group-expansions {
    background-color: #f3e5f5;
}

/* ===== PROJECT SETTINGS REPORT - IMPROVED SCROLLING UX ===== */

/* Container for the entire table section with vertical scrolling */
.project-settings-table-container {
    position: relative;
    max-height: 600px;
    overflow-y: auto;
}

/* Top scrollbar wrapper - creates a scrollbar at the top */
.top-scroll-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    height: 20px;
    margin-bottom: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #f8f9fa;
}

/* Invisible div inside top scroll that matches table width */
.top-scroll-content {
    height: 1px;
}

/* Main table wrapper for bottom scrollbar */
.table-scroll-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* Enhanced sticky table headers with shadow for depth */
#project-settings-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid #dee2e6;
}

/* Ensure column shading works with sticky headers - override previous rules */
#project-settings-table thead th {
    background-color: white;
}

#project-settings-table thead th.col-group-info {
    background-color: #f5f5f5;
}

#project-settings-table thead th.col-group-users {
    background-color: #e3f2fd;
}

#project-settings-table thead th.col-group-chatbot {
    background-color: #ffe4c4;
}

#project-settings-table thead th.col-group-expansions {
    background-color: #f3e5f5;
}

/* Add some padding to make the table more breathable */
#project-settings-table {
    margin-bottom: 0;
    white-space: nowrap;
}

#project-settings-table th,
#project-settings-table td {
    padding: 12px;
    vertical-align: middle;
}

/* ===== FROZEN FIRST COLUMN - PROJECT NAME STAYS VISIBLE ===== */

/* Make first column sticky horizontally - stays visible when scrolling left/right */
#project-settings-table th:first-child,
#project-settings-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 5; /* Below sticky headers (z-index: 10) but above regular cells */
    background-color: white; /* Prevent content from showing through */
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1); /* Subtle shadow on right edge */
}

/* Sticky header for first column needs highest z-index (sticky both vertically AND horizontally) */
#project-settings-table thead th:first-child {
    z-index: 15; /* Higher than both sticky headers (10) and sticky column (5) */
}

/* If first column uses col-group-info shading, ensure it has proper background */
#project-settings-table th:first-child.col-group-info,
#project-settings-table td:first-child.col-group-info {
    background-color: #f5f5f5; /* Match the col-group-info color */
}

/* Ensure first column has enough minimum width to be readable and truncate long names */
#project-settings-table th:first-child,
#project-settings-table td:first-child {
    min-width: 200px;
    max-width: 200px; /* Fixed width for consistent truncation (~30 chars) */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
