:root {
    --primary-color: #e5c07b;        /* Warm yellow/orange from One Dark Pro */
    --primary-dark: #d19a66;         /* Darker orange for hover states */
    --secondary-color: #61afef;      /* Bright blue for secondary elements */
    --accent-color: #98c379;         /* Soft green for accents */
    --danger-color: #e06c75;         /* Soft red for danger/delete actions */
    --text-color: #abb2bf;           /* Light gray for main text */
    --light-text: #828997;           /* Dimmer text for secondary content */
    --border-color: #3b4048;         /* Subtle borders */
    --light-bg: #282c34;             /* Main background */
    --dark-bg: #21252b;              /* Darker background for contrast */
    --white: #abb2bf;                /* Off-white text */
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    
    /* Additional colors for better UI */
    --button-text: #ffffff;
    --card-text: #abb2bf;
    --card-light-text: #828997;
    --highlight-bg: rgba(229, 192, 123, 0.1);  /* Subtle highlight background */
}

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

body {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--dark-bg);
    font-weight: 400;
}

p {
    margin-bottom: 20px;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

h1, h2, h3, h4, h5, h6 {
    /* font-family: 'VT323', 'Space Mono', 'IBM Plex Mono', monospace; */
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    color: var(--primary-color);
    text-shadow: 
        2px 2px 0 var(--dark-bg),
        3px 3px 0 var(--accent-color);
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    line-height: 1.2;
}

h1 {
    font-size: 2.4rem;
}

h2 {
    font-size: 1.9rem;
    border-bottom: 2px dotted var(--primary-color);
}

h3 {
    font-size: 1.5rem;
    padding-left: 18px;
}

h3::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--primary-dark);
    animation: blink 1s infinite;
}

h4 {
    font-size: 1.3rem;
    border-left: 3px solid var(--primary-color);
    padding-left: 10px;
}

h5, h6 {
    font-size: 1rem;
    color: var(--primary-dark);
}

/* Project title with arcade style */
#project-name {
    position: relative;
    display: inline-block;
    padding: 10px 20px;
    background: var(--dark-bg);
    border: 3px solid var(--primary-color);
    border-radius: 5px;
    box-shadow: 0 0 0 4px var(--dark-bg), 0 0 0 6px var(--border-color);
    margin-bottom: 20px;
}

/* Special styling for section titles */
.section-title {
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--primary-color) 25%, 
        var(--primary-color) 75%, 
        transparent 100%);
    color: var(--dark-bg);
    text-align: center;
    margin: 30px 0;
    padding: 5px 0;
    font-size: 1.5rem;
    position: relative;
    text-shadow: 2px 2px 0 var(--primary-dark);
}

.section-title::before,
.section-title::after {
    content: '* * *';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-bg);
    font-size: 1.2rem;
}

.section-title::before {
    left: 10px;
}

.section-title::after {
    right: 10px;
}

/* Pixelated highlight effect for headers when hovered */
h1:hover, h2:hover, h3:hover, h4:hover {
    transform: scale(1.03);
    transition: transform 0.2s ease;
}

/* Blinking cursor animation */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

button {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: var(--dark-bg);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

button.secondary {
    background-color: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
}

button.secondary:hover {
    background-color: var(--secondary-color);
    color: var(--dark-bg);
}

button.danger {
    background-color: var(--danger-color);
}

button.danger:hover {
    background-color: #c62828;
}

.hidden {
    display: none !important;
}

/* Auth Section */
.google-btn {
    display: inline-block;
    background-color: var(--white);
    color: var(--dark-bg) !important;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px 16px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s;
}

.google-btn:hover {
    background-color: var(--light-bg);
    color: var(--secondary-color) !important;
}

#user-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

#user-name {
    font-weight: 500;
}

/* Projects View */
.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border-color: var(--primary-color);
}

.project-card h3 {
    margin-bottom: 10px;
    color: var(--primary-dark);
    font-weight: 700;
}

.project-card p {
    color: var(--card-text);
    margin-bottom: 15px;
    font-weight: 500;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: var(--card-light-text);
    font-weight: 500;
}

/* Project Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1em;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Project Detail View */
.project-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

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

#segments-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.segment-card {
    background-color: var(--light-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s;
}

.segment-card:hover {
    transform: translateY(-3px);
}

.segment-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.segment-card-content {
    color: var(--text-color);
    font-weight: 500;
    white-space: pre-wrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    /* -webkit-line-clamp: 3; */
    -webkit-box-orient: vertical;
}

/* Segment Detail View */
.segment-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.segment-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.original-text-section,
.analysis-section {
    background-color: var(--light-bg);
    color: var(--text-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.tools-section {
    display: flex;
    flex-direction: column;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    height: auto;
    min-height: 50px;
}

.action-buttons button {
    flex: 0 0 auto;
    min-width: 120px;
    height: 38px;
}

.editable-content {
    min-height: 100px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin: 10px 0;
    background-color: var(--light-bg);
    color: var(--text-color);
    font-weight: 500;
    white-space: pre-wrap;
}

.editable-content:focus {
    outline: 2px solid var(--primary-color);
}

.conversation-section {
    background-color: var(--light-bg);
    color: var(--text-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

#conversation-messages {
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background-color: var(--dark-bg);
    color: var(--text-color);
    border-radius: 8px;
    margin-bottom: 15px;
}

.message {
    background-color: var(--light-bg);
    border-left: 3px solid var(--primary-color);
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 4px;
}

.message.user {
    border-left-color: var(--secondary-color);
}

.message.assistant {
    border-left-color: var(--accent-color);
}

.message-content {
    word-wrap: break-word;
}

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

.message.user .message-content {
    color: var(--dark-bg) !important;
}

.typing-indicator {
    display: inline-block;
    width: auto;
    font-size: 1.2em;
    letter-spacing: 2px;
    animation: typing 1.5s infinite;
}

/* Clear the float after messages */
#conversation-messages::after {
    content: "";
    display: table;
    clear: both;
}

/* Improve the chat input area */
.chat-input-container {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

#chat-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 1em;
    background-color: var(--dark-bg);
    color: var(--text-color);
}

#send-message-btn {
    padding: 0 20px;
    border-radius: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .project-header,
    .projects-header,
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    /* Update user section for mobile */
    #user-section {
        width: 100%;
        justify-content: space-between;
    }
    
    .project-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .projects-list {
        grid-template-columns: 1fr;
    }
    
    /* Add hamburger menu for very small screens */
    @media (max-width: 480px) {
        header {
            position: relative;
        }
        
        #nav-toggle {
            display: block;
            background: none;
            border: none;
            color: var(--primary-color);
            font-size: 1.5rem;
            cursor: pointer;
            position: absolute;
            top: 15px;
            right: 15px;
            z-index: 100;
        }
        
        .nav-menu {
            display: none;
            width: 100%;
            flex-direction: column;
            gap: 10px;
            margin-top: 10px;
        }
        
        .nav-menu.active {
            display: flex;
        }
        
        /* Stack buttons vertically on very small screens */
        .project-actions {
            flex-direction: column;
            align-items: stretch;
        }
        
        .project-actions button {
            margin-bottom: 8px;
        }
    }
}

.back-to-projects-btn {
    background-color: var(--light-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    font-weight: 600;
}

.back-to-projects-btn:hover {
    background-color: var(--border-color);
}

/* Add Google Font */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    margin-left: 5px;
}

.status-badge.translated {
    background-color: var(--primary-color);
    color: var(--button-text);
}

.status-badge.analyzed {
    background-color: var(--accent-color);
    color: var(--secondary-color);
}

/* Friend Items */
.friend-item {
    background-color: var(--light-bg);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.friend-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.friend-info h4 {
    color: var(--text-color);
    margin: 0;
    font-weight: 600;
}

.friend-info p {
    color: var(--light-text);
    margin: 0;
    font-size: 0.9em;
}

.friends-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.friends-header h2 {
    margin: 0;
    flex-grow: 1;
}

/* Add styling for shared projects */
.sharing-info {
    background-color: var(--accent-color);
    color: var(--secondary-color);
    padding: 5px 10px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 0.9em;
    font-weight: 600;
}

/* Add a subtle border for shared projects */
.project-card.shared {
    border-left: 4px solid var(--accent-color);
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 126, 0, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Inline spinner for buttons */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* For streaming responses */
.typing-indicator {
    display: inline-block;
    animation: typing 1.5s infinite;
    font-weight: bold;
}

@keyframes typing {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

/* Tags styling */
.tag {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--dark-bg);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    margin-right: 5px;
    margin-bottom: 5px;
    cursor: pointer;
}

.tag:hover {
    background-color: var(--primary-color);
    color: var(--dark-bg);
}

.tag-filter {
    margin-bottom: 20px;
    position: relative;
}

#tag-filter {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--dark-bg);
    color: var(--text-color);
    font-size: 1rem;
}

.active-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.active-tag {
    display: inline-flex;
    align-items: center;
    background-color: var(--primary-color);
    color: var(--dark-bg);
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 500;
}

.remove-tag {
    background: none;
    border: none;
    color: var(--dark-bg);
    margin-left: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 4px;
    border-radius: 50%;
}

.remove-tag:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

.clear-all-tags {
    margin-top: 10px;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.clear-all-tags:hover {
    background-color: var(--light-bg);
}

/* Make project tags clickable */
.tag {
    cursor: pointer;
    transition: transform 0.2s;
}

.tag:hover {
    transform: scale(1.05);
}

/* Annotation styling */
.annotation-marker {
    background-color: rgba(255, 126, 0, 0.2);
    border-bottom: 2px dotted var(--primary-color);
    cursor: pointer;
    position: relative;
}

.annotation-marker:hover {
    background-color: rgba(255, 126, 0, 0.3);
}

.annotation-popup {
    position: absolute;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    box-shadow: var(--shadow);
    z-index: 100;
    max-width: 300px;
    top: 100%;
    left: 0;
}

.annotation-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.annotation-popup-header .annotation-author {
    font-size: 0.8em;
    color: var(--light-text);
}

.annotation-popup-content {
    margin-bottom: 10px;
}

.annotation-popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

.annotation-toolbar {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: var(--light-bg);
    border-radius: 5px;
}

.annotation-instructions {
    flex: 1;
    font-size: 0.9em;
    color: var(--light-text);
}

.annotation-btn {
    margin-right: 10px;
}

.annotation-btn.active {
    background-color: var(--accent-color);
}

.annotation-color-picker {
    display: flex;
    gap: 5px;
}

.color-option {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}

.color-option.selected {
    border-color: var(--white);
}

/* Annotator color */
.annotation-marker.annotator {
    background-color: rgba(243, 156, 18, 0.2);
    border-bottom: 2px dotted var(--accent-color);
}

.annotation-marker.annotator:hover {
    background-color: rgba(243, 156, 18, 0.3);
}

/* Add styles for conversation selector */
.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

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

#conversation-selector {
    min-width: 150px;
}

/* Style for collaborator badges */
.collaborator-badge {
    display: inline-flex;
    align-items: center;
    background-color: var(--light-bg);
    border-radius: 20px;
    padding: 5px 10px;
    margin-right: 10px;
    margin-bottom: 10px;
}

.collaborator-badge .collaborator-name {
    margin-right: 5px;
}

.collaborator-badge .access-level {
    font-size: 0.8em;
    padding: 2px 6px;
    border-radius: 10px;
    background-color: var(--accent-color);
    color: var(--dark-bg);
}

.collaborator-badge .access-level.editor {
    background-color: var(--primary-color);
    color: var(--dark-bg);
}

.collaborator-badge .remove-collaborator {
    margin-left: 5px;
    cursor: pointer;
    color: var(--light-text);
}

.collaborator-badge .remove-collaborator:hover {
    color: var(--danger-color);
}

/* Add styles for annotation system */
.annotation-toolbar {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: var(--light-bg);
    border-radius: 5px;
}

.annotation-instructions {
    flex: 1;
    font-size: 0.9em;
    color: var(--light-text);
}

.annotation-btn {
    margin-right: 10px;
}

.annotation-btn.active {
    background-color: var(--accent-color);
}

.annotation-color-picker {
    display: flex;
    gap: 5px;
}

.color-option {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}

.color-option.selected {
    border-color: var(--white);
}

.annotation-marker {
    position: relative;
    border-bottom: 2px solid;
    cursor: pointer;
}

.annotation-popup {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    min-width: 200px;
    max-width: 300px;
    background-color: var(--light-bg);
    border-radius: 5px;
    box-shadow: var(--shadow);
    padding: 10px;
    margin-top: 5px;
}

.annotation-popup-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.8em;
    color: var(--light-text);
}

.annotation-popup-content {
    margin-bottom: 10px;
}

.annotation-popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

/* Simplified annotation system */
.annotations-section {
    margin-top: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background-color: var(--light-bg);
    border-radius: 5px;
}

.annotations-section h4 {
    margin-bottom: 10px;
    color: var(--white);
}

.annotations-list {
    margin-bottom: 15px;
}

.annotation-item {
    background-color: var(--light-bg);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
}

.annotation-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.8em;
    color: var(--text-color);
}

.annotation-content {
    margin-bottom: 10px;
}

.annotation-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

.no-annotations {
    color: var(--light-text);
    font-style: italic;
}

.color-picker {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

/* Improved chat styling */
.conversation-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.conversation-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    margin-bottom: 15px;
    max-width: 85%;
}

.message.user {
    background-color: var(--primary-dark);
    border-left: 4px solid var(--primary-color);
    margin-left: 20%;
    margin-right: 5%;
    padding: 10px;
    border-radius: 8px;
    color: var(--dark-bg);
}

.message.assistant {
    background-color: var(--light-bg);
    border-left: 4px solid var(--accent-color);
    margin-right: 20%;
    margin-left: 5%;
    padding: 10px;
    border-radius: 8px;
    color: var(--text-color);
}

.message.system {
    align-self: center;
    background-color: rgba(231, 76, 60, 0.1);
    border-left: 3px solid var(--danger-color);
    padding: 8px 12px;
    border-radius: 4px;
    max-width: 90%;
}

.message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 8px;
    flex-shrink: 0;
}

.user-avatar {
    background-color: var(--primary-color);
}

.assistant-avatar {
    background-color: var(--accent-color);
}

.system-avatar {
    background-color: var(--danger-color);
}

.message-content {
    padding: 10px 15px;
    border-radius: 18px;
    background-color: var(--light-bg);
    box-shadow: var(--shadow);
}

.message.user .message-content {
    background-color: var(--primary-color);
    color: var(--white);
    border-top-right-radius: 4px;
}

.message.assistant .message-content {
    background-color: var(--light-bg);
    border-top-left-radius: 4px;
}

.chat-input-container {
    display: flex;
    gap: 10px;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
}

.chat-input-container textarea {
    flex: 1;
    padding: 10px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--dark-bg);
    color: var(--text-color);
    resize: none;
    min-height: 40px;
    max-height: 120px;
}

.chat-input-container button {
    border-radius: 20px;
    padding: 0 20px;
}

/* Code formatting in messages */
.message-content code {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
}

.message-content pre {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 10px 0;
}

.message-content pre code {
    background-color: transparent;
    padding: 0;
}

/* Collaboration requests styling */
.collaboration-requests-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.collaboration-request {
    background-color: var(--light-bg);
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.request-details h4 {
    margin-bottom: 5px;
}

.request-details p {
    margin: 5px 0;
    font-size: 0.9em;
    color: var(--light-text);
}

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

/* Collaborative project styling */
.project-card.collaborative {
    border-left: 4px solid var(--accent-color);
}

.sharing-info.collaborative {
    background-color: var(--accent-color);
    color: var(--dark-bg);
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    display: inline-block;
    margin-top: 5px;
}

/* Collaborative project indicator */
.collaborative-indicator {
    background-color: var(--accent-color);
    color: var(--white);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    margin: 0 15px;
    display: inline-block;
}

/* Add styles for read-only elements */
.readonly {
    background-color: #f8f9fa;
    opacity: 0.9;
    cursor: not-allowed;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px;
}

.readonly:focus {
    outline: none;
    box-shadow: none;
}

/* Annotation styles */
.annotation-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.annotation-btn {
    padding: 6px 12px;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
}

.annotation-btn.active {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.color-picker {
    display: flex;
    gap: 5px;
}

.color-option {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-option:hover {
    transform: scale(1.2);
}

.color-option.selected {
    box-shadow: 0 0 0 2px white, 0 0 0 4px black;
}

.annotation-item {
    background-color: var(--light-bg);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
}

.annotation-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.8em;
    color: var(--text-color);
}

.annotation-text {
    margin: 8px 0;
    font-style: italic;
    color: #555;
}

.annotation-comment {
    margin: 8px 0;
    background-color: #f9f9f9;
    padding: 8px;
    border-radius: 4px;
    color: #333;
}

.annotation-actions {
    display: flex;
    justify-content: flex-end;
}

.delete-annotation-btn {
    background-color: var(--danger-color);
    color: white;
    padding: 3px 8px;
    font-size: 0.8em;
}

.highlighted-text {
    cursor: pointer;
    transition: opacity 0.3s;
}

.highlighted-text:hover {
    opacity: 0.7 !important;
}

/* Note styles */
.note-entry {
    border-left: 3px solid var(--primary-color);
    padding-left: 10px;
    margin-bottom: 15px;
}

.note-attribution {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 5px;
}

.note-content {
    padding: 5px 0;
}

/* Improve annotation form appearance */
.annotation-form {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    box-shadow: var(--shadow);
    z-index: 1000;
    max-width: 300px;
    color: var(--text-color);
}

.annotation-form textarea {
    width: 100%;
    min-height: 80px;
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--dark-bg);
    color: var(--text-color);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Make annotatable elements clearly indicate they accept annotations */
.annotatable {
    position: relative;
}

.annotatable:hover::after {
    content: "Select text to annotate";
    position: absolute;
    top: -25px;
    right: 0;
    background-color: #f0f0f0;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.8em;
    color: #333;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.annotatable.annotation-mode:hover::after {
    opacity: 1;
}

.highlighted-text {
    cursor: pointer;
    border-radius: 2px;
    padding: 0 2px;
    transition: opacity 0.3s;
}

.highlighted-text:hover {
    opacity: 0.7 !important;
}

/* Flash effect for finding annotations */
@keyframes highlightFlash {
    0% { background-color: rgba(255, 126, 0, 0.2); }
    50% { background-color: rgba(255, 126, 0, 0.5); }
    100% { background-color: rgba(255, 126, 0, 0.2); }
}

.highlight-flash {
    animation: highlightFlash 1s ease-in-out;
}

/* Styling for annotation sections */
.annotation-section {
    margin-top: 5px;
    margin-bottom: 20px;
    border-top: 1px dashed #ccc;
    padding-top: 10px;
}

/* Make sure annotations are always displayed below their respective content */
#original-annotation-section {
    order: 3; /* After original text section */
}

#translation-annotation-section {
    order: 5; /* After translation section */
}

.admin-link {
    display: inline-block;
    margin-left: 10px;
    padding: 5px 10px;
    background-color: var(--primary-dark);
    color: var(--dark-bg);
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.admin-link:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Responsive Navigation - Add after the header styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 15px; /* Add space between wrapped elements */
}

/* Add/Update responsive styles */
@media (max-width: 768px) {
    .project-header,
    .projects-header,
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    /* Update user section for mobile */
    #user-section {
        width: 100%;
        justify-content: space-between;
    }
    
    .project-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .projects-list {
        grid-template-columns: 1fr;
    }
    
    /* Footer responsive */
    .footer-content {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Add hamburger menu for very small screens */
    @media (max-width: 480px) {
        header {
            position: relative;
        }
        
        #nav-toggle {
            display: block;
            background: none;
            border: none;
            color: var(--primary-color);
            font-size: 1.5rem;
            cursor: pointer;
            position: absolute;
            top: 15px;
            right: 15px;
            z-index: 100;
        }
        
        .nav-menu {
            display: none;
            width: 100%;
            flex-direction: column;
            gap: 10px;
            margin-top: 10px;
        }
        
        .nav-menu.active {
            display: flex;
        }
        
        /* Stack buttons vertically on very small screens */
        .project-actions {
            flex-direction: column;
            align-items: stretch;
        }
        
        .project-actions button {
            margin-bottom: 8px;
        }
    }
}

/* Make sure buttons don't overflow on small screens */
button, .google-btn {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Give some breathing room to stacked elements */
.stacked-on-mobile {
    margin-bottom: 15px;
}

/* Privacy Policy Styles */
.privacy-policy-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 8px;
    background-color: var(--light-bg, #2a2a2a);
    border: 1px solid var(--border-color, #444);
    color: var(--text-color, #e0e0e0);
    font-family: 'VT323', 'IBM Plex Mono', monospace;
  }
  
  .privacy-policy-container h2 {
    text-align: center;
    color: var(--primary-color, #f5a623);
    margin-bottom: 20px;
    border-bottom: 1px dotted var(--primary-color, #f5a623);
    padding-bottom: 10px;
  }
  
  .privacy-policy-container h3 {
    color: var(--primary-color, #f5a623);
    margin-top: 20px;
    margin-bottom: 10px;
  }
  
  .privacy-policy-content {
    line-height: 1.6;
  }
  
  .privacy-policy-content ul {
    list-style-type: square;
    margin-left: 20px;
    margin-bottom: 15px;
  }
  
  .privacy-policy-content strong {
    color: var(--accent-color, #ff6b6b);
    font-weight: bold;
  }
  
  .privacy-policy-content a {
    color: var(--primary-color, #f5a623);
    text-decoration: underline;
  }
  
  .privacy-policy-content a:hover {
    text-decoration: none;
  }
  
  /* Make sure to add this modal-like functionality for mobile views */
  @media (max-width: 768px) {
    .privacy-policy-container {
      padding: 15px;
      margin: 10px;
      max-height: 400px;
      overflow-y: auto;
    }
    
    .privacy-policy-content {
      font-size: 0.9rem;
    }
  }


  .instructions-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 8px;
    background-color: var(--light-bg, #2a2a2a);
    border: 1px solid var(--border-color, #444);
    color: var(--text-color, #e0e0e0);
    font-family: 'VT323', 'IBM Plex Mono', monospace;
  }
  
  .instructions-container h2 {
    text-align: center;
    color: var(--primary-color, #f5a623);
    margin-bottom: 20px;
    border-bottom: 1px dotted var(--primary-color, #f5a623);
    padding-bottom: 10px;
  }
  
  .instructions-container h3 {
    color: var(--primary-color, #f5a623);
    margin-top: 20px;
    margin-bottom: 10px;
  }
  
  .instructions-content {
    line-height: 1.6;
  }
  
  .instructions-content ul {
    list-style-type: square;
    margin-left: 20px;
    margin-bottom: 15px;
  }
  
  .instructions-content strong {
    color: var(--accent-color, #ff6b6b);
    font-weight: bold;
  }
  
  .instructions-content a {
    color: var(--primary-color, #f5a623);
    text-decoration: underline;
  }
  
  .instructions-content a:hover {
    text-decoration: none;
  }
  
  /* Make sure to add this modal-like functionality for mobile views */
  @media (max-width: 768px) {
    .instructions-container {
      padding: 15px;
      margin: 10px;
      max-height: 400px;
      overflow-y: auto;
    }
    
    .instructions-content {
      font-size: 0.9rem;
    }
  }

/* Searchable Dropdown Styles */
.searchable-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-search {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--dark-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 1em;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 0 0 4px 4px;
    z-index: 100;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.dropdown-content h4 {
    margin: 0;
    padding: 10px;
    background-color: var(--dark-bg);
    color: var(--primary-color);
    font-size: 0.9em;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-item:hover {
    background-color: var(--dark-bg);
}

.dropdown-separator {
    height: 1px;
    background-color: var(--border-color);
    margin: 5px 0;
}

.pinned-languages-section {
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item.pinned {
    background-color: rgba(229, 192, 123, 0.1);
}

.pin-language-btn,
.unpin-language-btn {
    background: none;
    border: none;
    font-size: 1em;
    cursor: pointer;
    padding: 2px 5px;
    color: var(--light-text);
}

.pin-language-btn:hover,
.unpin-language-btn:hover {
    color: var(--primary-color);
}

.no-results {
    padding: 10px;
    text-align: center;
    color: var(--light-text);
    font-style: italic;
} 

.sort-toggle-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.sort-toggle-btn {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.sort-toggle-btn:hover {
    background-color: #e9e9e9;
}

.sort-icon {
    font-weight: bold;
    font-size: 16px;
}
/* Add styles for annotation context label */
.annotation-context {
    font-size: 12px;
    background-color: #f0f0f0;
    border-radius: 4px;
    padding: 2px 6px;
    margin-left: 8px;
    color: #666;
}

/* Add styles for model selectors */
.model-selectors {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Add highlight flash effect */
@keyframes highlight-flash {
    0% { background-color: transparent; }
    25% { background-color: rgba(255, 126, 0, 0.3); }
    75% { background-color: rgba(255, 126, 0, 0.3); }
    100% { background-color: transparent; }
}

.highlight-flash {
    animation: highlight-flash 1.5s ease-in-out;
}

/* Footer styles */
footer {
    margin-top: 50px;
    padding: 20px;
    background-color: var(--dark-bg);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links a {
    color: var(--secondary-color);
    text-decoration: none;
    margin-right: 20px;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-copyright {
    color: var(--light-text);
    font-size: 0.9rem;
}