:root {
    --primary-color: #2196F3;
    --secondary-color: #1976D2;
    --background-color: #f5f5f5;
    --card-background: #ffffff;
    --text-color: #333333;
    --error-color: #f44336;
    --success-color: #4caf50;
    --pending-color: #9e9e9e;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

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

h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-weight: 600;
}

/* Quantization controls */
.quant-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

#returnToSelectButton {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
}

/* Models section */
.models-section {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.models-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.model-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
}

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

.model-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.model-name {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-color);
}

.download-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quant-label {
    font-weight: bold;
    width: 60px;
}

.model-size {
    font-size: 0.85rem;
    color: #666;
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status.pending {
    background-color: var(--pending-color);
    color: white;
}

.status.ready {
    background-color: var(--success-color);
    color: white;
}

.download-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

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

.download-button:disabled {
    background-color: var(--pending-color);
    cursor: not-allowed;
}

/* Progress bar */
.download-container {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #eee;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 5px; /* Add space between button and progress bar */
}

.progress {
    background-color: var(--primary-color);
    width: 0%;
    height: 100%;
    transition: width 0.3s ease;
}

.progress.indeterminate {
    position: relative;
    width: 100% !important;
    background-color: rgba(33, 150, 243, 0.3);
    background-image: linear-gradient(to right, transparent, rgba(33, 150, 243, 0.5), transparent);
    background-size: 200px 100%;
    background-repeat: repeat-x;
    animation: indeterminateBar 1.5s infinite linear;
}

@keyframes indeterminateBar {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: 200px 0;
    }
}

/* Input section */
.input-section {
    margin-bottom: 2rem;
}

.input-wrapper {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.button-group {
    display: flex;
    gap: 1rem;
}

.primary-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

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

/* Results section */
.results-section {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-group {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.result-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.result-content {
    white-space: pre-wrap;
    font-family: inherit;
    line-height: 1.6;
    color: var(--text-color); /* Explicit text color */
}

.not-downloaded-output {
    font-style: italic;
    opacity: 0.6;
    color: var(--pending-color);
}

/* Reading score styles */
.reading-score {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    display: inline-block;
}

/* Highlighted sentences */
.highlighted-sentence {
    position: relative;
    border-radius: 2px;
    padding: 2px 0;
    margin-right: 4px;
    color: var(--text-color) !important; /* Force solid text color */
}

.highlighted-sentence:hover {
    opacity: 0.8;
}

.highlighted-sentence-0 {
    background-color: rgba(66, 133, 244, 0.25); /* Google Blue */
}

.highlighted-sentence-1 {
    background-color: rgba(234, 67, 53, 0.25); /* Google Red */
}

.highlighted-sentence-2 {
    background-color: rgba(251, 188, 5, 0.25); /* Google Yellow */
}

.highlighted-sentence-3 {
    background-color: rgba(52, 168, 83, 0.25); /* Google Green */
}

/* Loading indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error message */
.error-message {
    background-color: #ffebee;
    color: var(--error-color);
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    text-align: center;
}

/* Splash screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(228, 228, 228, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.splash-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
}

.splash-content h2 {
    margin-bottom: 1rem;
}

.splash-content p {
    margin-bottom: 1.5rem;
    line-height: 1.5;
    max-width: 500px;
}

.quant-options {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.quant-button {
    padding: 0.8rem 1.5rem;
    border: none;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

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

.hidden {
    display: none;
}

/* Responsive styles */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .button-group {
        flex-direction: column;
    }

    .model-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .model-name {
        word-break: break-all;
    }
    
    .quant-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Highlight toggle styles */
.highlight-toggle {
    margin: 1rem 0;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    display: flex;
    align-items: center;
  }
  
  .highlight-toggle input {
    margin-right: 0.5rem;
  }
  
  .highlight-toggle.hidden {
    display: none;
  }

  .no-highlight .highlighted-sentence {
    background-color: transparent !important;
    color: var(--text-color) !important; /* Keep text visible when highlight is off */
}