/**
 * LLMquality Styles
 * Enhanced UI for genealogical data processing application
 */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 2.5rem;
    color: #4a5568;
    margin-bottom: 10px;
    font-weight: 700;
}

header h1 .version {
    font-size: 0.8rem;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    margin-left: 10px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

header p {
    font-size: 1.1rem;
    color: #718096;
    font-weight: 400;
}

/* Main content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Form styles */
.form-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
    font-size: 1rem;
}

.form-group select,
.form-group input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group select:focus,
.form-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-help {
    margin-top: 5px;
    font-size: 0.875rem;
    color: #718096;
}

/* Button styles */
.form-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* File upload styles */
.file-upload-container {
    position: relative;
}

.btn-upload {
    width: 100%;
    padding: 12px 16px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-height: 60px;
    justify-content: center;
}

.btn-upload:hover {
    border-color: #667eea;
    background: #f0f0ff;
    color: #667eea;
    transform: none;
    box-shadow: none;
}

.btn-upload.file-selected {
    border-color: #10b981;
    background: #ecfdf5;
    color: #065f46;
    border-style: solid;
}

.upload-text {
    font-weight: 600;
    font-size: 0.95rem;
}

.file-name {
    font-size: 0.85rem;
    color: #059669;
    font-weight: 500;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(0);
}

/* Button variants */
#rateBtn, .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.btn-info {
    background: #38b2ac;
    color: white;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* Loading spinner */
.btn-spinner {
    animation: spin 1s linear infinite;
    font-size: 1.2rem;
}

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

/* Results section */
.results-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.results-section h3 {
    margin: 0;
    color: #4a5568;
    font-size: 1.3rem;
}

.results-textarea {
    width: 100%;
    height: 300px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    background: #f7fafc;
    color: #2d3748;
    line-height: 1.5;
}

.results-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 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(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 750px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 25px 30px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #4a5568;
    font-size: 1.4rem;
    margin: 0;
}

.modal-close {
    font-size: 28px;
    font-weight: bold;
    color: #a0aec0;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #718096;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px 30px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* Directory input styles */
.directory-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.directory-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 400px;
    box-sizing: border-box;
}

.directory-input input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-browse {
    padding: 12px 20px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.btn-browse:hover {
    background-color: #5a6268;
}

.btn-browse:active {
    background-color: #545b62;
}

/* Configuration modal input styles */
#configModal .form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 500px;
    box-sizing: border-box;
}

#configModal .form-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Save file modal input styles */
#saveFileModal .form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 400px;
    box-sizing: border-box;
}

/* Help content styles */
.help-content {
    line-height: 1.7;
}

.help-content h3 {
    color: #4a5568;
    margin: 20px 0 10px 0;
    font-size: 1.1rem;
}

.help-content h3:first-child {
    margin-top: 0;
}

.help-content p,
.help-content li {
    color: #718096;
    margin-bottom: 8px;
}

.help-content ol,
.help-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.help-content strong {
    color: #4a5568;
    font-weight: 600;
}

/* Error container */
.error-container {
    background: rgba(254, 226, 226, 0.95);
    border: 1px solid #f56565;
    color: #c53030;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.error-container h3 {
    margin-bottom: 10px;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    button {
        width: 100%;
        justify-content: center;
    }
    
    .directory-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
}
