/* Basic styles for LLM Prompt Evolution Playground */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-image {
    height: 50px;
    width: auto;
}

.logo-text {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}







.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

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

main.container {
    min-height: calc(100vh - 200px);
}

/* Login page styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.login-box h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.login-box p {
    margin-bottom: 2rem;
    color: #666;
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-google {
    background: white;
    color: #333;
    border-color: #ddd;
}

.btn-microsoft {
    background: #2f2f2f;
    color: white;
    border-color: #2f2f2f;
}

.btn img {
    width: 20px;
    height: 20px;
}

.login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    font-size: 0.875rem;
}

.login-footer a {
    color: #3498db;
    text-decoration: none;
}

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

/* Error page styles */
.error-container {
    text-align: center;
    padding: 3rem 1rem;
}

.error-container h2 {
    color: #e74c3c;
    margin-bottom: 1rem;
}

.error-container p {
    color: #666;
    margin-bottom: 2rem;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 4rem;
}

footer p {
    margin: 0;
    font-size: 0.875rem;
}

/* Playground styles */
.playground-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.playground-header {
    text-align: center;
    margin-bottom: 3rem;
}

.playground-header h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.playground-header p {
    color: #666;
    font-size: 1.1rem;
}

.section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.section textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    resize: vertical;
}

.section textarea:focus {
    outline: none;
    border-color: #3498db;
}

.controls {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.provider-selector {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.provider-selector label {
    font-weight: 500;
    color: #555;
}

.provider-selector select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.btn-primary {
    background: #3498db;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

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

.btn-primary:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.output-display {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 4px;
    border-left: 4px solid #3498db;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.status-section {
    position: sticky;
    bottom: 1rem;
}

#status-message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.status-loading {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

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

.status-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

#metadata-display {
    font-size: 0.9rem;
    color: #666;
}

/* Timeline styles */
.timeline-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.timeline-header {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-header h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.chain-info {
    margin: 1rem 0;
}

.chain-info h2 {
    color: #34495e;
    font-size: 1.3rem;
}

.chain-info p {
    color: #666;
    margin: 0.25rem 0;
}

.timeline-actions {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

.timeline-steps {
    position: relative;
}

.timeline-step {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
}

.timeline-step.step-input {
    border-left-color: #9b59b6;
}

.timeline-step.step-generated_prompt {
    border-left-color: #3498db;
}

.timeline-step.step-generated_text {
    border-left-color: #2ecc71;
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.step-number {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.step-type {
    background: #ecf0f1;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #555;
}

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

.step-content pre {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.step-metadata {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f0f8ff;
    border-radius: 4px;
    font-size: 0.85rem;
}

.metadata-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 0.25rem;
}

.metadata-item {
    display: inline-block;
    margin-right: 1rem;
    color: #666;
}

.step-timestamp {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #999;
}

.timeline-arrow {
    text-align: center;
    font-size: 2rem;
    color: #bdc3c7;
    margin: 0.5rem 0;
}

/* History styles */
.history-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.history-header h1 {
    color: #2c3e50;
}

.chains-list {
    display: grid;
    gap: 1.5rem;
}

.chain-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
}

.chain-title h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

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

.chain-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

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

.btn-danger:hover {
    background: #c0392b;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.empty-state p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Responsive styles */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .provider-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .timeline-actions,
    .chain-actions {
        flex-direction: column;
    }

    .history-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* Evolution Timeline Styles */
.evolution-timeline {
    max-width: 900px;
    margin: 0 auto;
}

.iteration-block {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
}

.iteration-title {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ecf0f1;
}

.iteration-number {
    color: #3498db;
    font-weight: bold;
}

.iteration-step {
    margin-bottom: 2rem;
}

.iteration-step:last-child {
    margin-bottom: 0;
}

.iteration-step h3 {
    color: #34495e;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.iteration-step textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

.iteration-step textarea:disabled {
    background-color: #f8f9fa;
    color: #495057;
    cursor: not-allowed;
}

.iteration-step .output-display {
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    min-height: 100px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.iteration-step .controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.provider-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.provider-selector label {
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.provider-selector select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
}

/* Status section */
.status-section {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 2rem;
}

#status-message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.status-loading {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.status-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

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

.status-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

#metadata-display {
    font-size: 0.85rem;
    color: #6c757d;
}

.metadata {
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #6c757d;
}

/* Responsive design */
@media (max-width: 768px) {
    .iteration-step .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .provider-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
    }
}

/* Admin Config Styles */
.admin-config-container {
    max-width: 1000px;
    margin: 0 auto;
}

.config-section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.provider-card {
    border: 1px solid #ddd;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.form-group {
    margin-bottom: 1rem;
}

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

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-row {
    display: flex;
    gap: 2rem;
}

.models-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.models-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

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

.model-item.unavailable {
    opacity: 0.5;
}

.model-item .unavailable {
    text-decoration: line-through;
    color: #999;
}

.last-refreshed {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

.last-refreshed.warning {
    color: #d9534f;
}

.form-actions {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 1rem;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.status-success {
    color: #28a745;
    font-weight: bold;
    margin-top: 1rem;
}

.status-error {
    color: #dc3545;
    font-weight: bold;
    margin-top: 1rem;
}

.help-text {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

.meta-info {
    font-size: 0.85rem;
    color: #999;
    margin-top: 1rem;
}

/* History Page Improvements */
.history-container {
    max-width: 900px;
    margin: 0 auto;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.history-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

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

#sort-select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: white;
}

.chains-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chain-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
}

.chain-info h3 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
}

.chain-meta {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.chain-actions {
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 8px;
}

.empty-state p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1.5rem;
}

/* Delete Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    margin-top: 0;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Privacy Policy Styles */
.privacy-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    line-height: 1.8;
}

.privacy-container h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
}

.privacy-container h2 {
    color: #2c3e50;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ecf0f1;
    font-size: 1.8rem;
}

.privacy-container h3 {
    color: #34495e;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
}

.privacy-container h4 {
    color: #34495e;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.last-updated, .effective-date {
    color: #666;
    font-style: italic;
    margin-bottom: 0.25rem;
}

.privacy-container section {
    margin-bottom: 2rem;
}

.privacy-container ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.privacy-container li {
    margin: 0.5rem 0;
}

.privacy-container a {
    color: #3498db;
    text-decoration: none;
}

.privacy-container a:hover {
    text-decoration: underline;
}

.info-box, .highlight-box, .warning-box, .third-party-box {
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.info-box {
    background: #f0f8ff;
    border-left-color: #3498db;
}

.highlight-box {
    background: #f0fff4;
    border-left-color: #2ecc71;
}

.warning-box {
    background: #fff5f5;
    border-left-color: #e74c3c;
}

.third-party-box {
    background: #fef9e7;
    border-left-color: #f39c12;
    margin-bottom: 1rem;
}

.legal-basis-table, .retention-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.legal-basis-table th, .retention-table th {
    background: #34495e;
    color: white;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
}

.legal-basis-table td, .retention-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #ecf0f1;
}

.legal-basis-table tr:hover, .retention-table tr:hover {
    background: #f8f9fa;
}

.rights-list {
    margin: 1.5rem 0;
}

.rights-list h3 {
    color: #2980b9;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.acknowledgment {
    text-align: center;
    font-style: italic;
    color: #666;
    margin: 2rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.version-info {
    text-align: center;
    font-size: 0.85rem;
    color: #999;
    margin-top: 1rem;
}

.privacy-container hr {
    border: none;
    border-top: 1px solid #ecf0f1;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .privacy-container {
        padding: 1rem;
    }
    
    .privacy-container h1 {
        font-size: 2rem;
    }
    
    .privacy-container h2 {
        font-size: 1.5rem;
    }
    
    .legal-basis-table, .retention-table {
        font-size: 0.9rem;
    }
}
