/* Base styles */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #ffffff;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    color: var(--text-color);
    background: var(--bg-color);
    padding: 1rem;
}

/* Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.tabs-left {
    display: flex;
    gap: 0.5rem;
}

.tabs-right {
    display: flex;
    align-items: center;
}

.feedback-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.feedback-btn:hover {
    background-color: var(--border-color);
}

.feedback-btn:focus {
    outline: none;
    box-shadow: var(--focus-ring);
}

.tab {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.tab:hover {
    background-color: var(--border-color);
}

.tab.active {
    color: var(--primary-color);
    font-weight: 600;
}

.tab:focus {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* Forms */
.tab-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tab-panel.hidden {
    display: none;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

label {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
    overflow: hidden;
    min-height: 2.5rem;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
}

/* Field sections */
.field-section {
    padding: 0;
    margin-bottom: 0.5rem;
}

.field-section:last-child {
    margin-bottom: 0;
}

.field-section label {
    display: block;
    margin-bottom: 0.25rem;
}

.field-section .form-group {
    margin: 0;
}

/* Actions */
.actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin: 0.25rem 0;
    position: sticky;
    bottom: 1rem;
    background: var(--bg-color);
    padding: 0.5rem 0;
    border-radius: 0.375rem;
    z-index: 10;
}

button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

#refine-button {
    background-color: var(--primary-color);
    color: white;
}

#refine-button:hover:not(.processing) {
    background-color: var(--primary-hover);
}

#refine-button.processing {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Output section */
.output-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
    position: relative;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-color);
    padding: 0.5rem 0;
    z-index: 10;
}

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

.report-btn {
    background-color: #dc2626;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.report-btn:hover:not(:disabled) {
    background-color: #b91c1c;
}

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

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

#copy-button:hover {
    background-color: var(--border-color);
}

#refined-output {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    white-space: pre-wrap;
    background-color: #f9fafb;
    min-height: 100px;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    color: #6b7280;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.close-btn:hover {
    background-color: var(--border-color);
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
}

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

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

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

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

.btn-secondary:hover {
    background-color: var(--border-color);
}

#feedback-message {
    min-height: 120px;
    resize: vertical;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    body {
        padding: 0.5rem;
    }
    
    .container {
        gap: 1rem;
    }
    
    textarea {
        font-size: 0.875rem;
    }
    
    button {
        width: 100%;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .tabs {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .tabs-left {
        justify-content: center;
    }
    
    .tabs-right {
        justify-content: center;
    }
    
    .feedback-btn {
        width: auto;
        max-width: 200px;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-actions button {
        width: 100%;
    }
    
    .output-actions {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .report-btn,
    #copy-button {
        width: 100%;
    }
} 

 