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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#app {
    width: 100%;
    max-width: 600px;
}

.container {
    background: white;
    border-radius: 4px;
    padding: 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.title {
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.file-upload-area {
    border: 2px dashed #ccc;
    border-radius: 4px;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fafafa;
}

.file-upload-area:hover {
    border-color: #999;
    background-color: #f5f5f5;
}

.file-upload-area.has-file {
    border-color: #5cb85c;
    background-color: #f9f9f9;
    border-style: solid;
}

.file-input {
    display: none;
}

.file-icon {
    font-size: 14px;
    margin-bottom: 10px;
    color: #666;
    font-weight: bold;
}

.file-label {
    color: #666;
    font-size: 16px;
    margin-bottom: 10px;
}

.file-name {
    color: #4CAF50;
    font-weight: bold;
    font-size: 14px;
    word-break: break-word;
    margin-top: 10px;
}

.btn {
    padding: 12px 24px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-bottom: 10px;
    color: white;
    background-color: #337ab7;
}

.btn:hover:not(:disabled) {
    background-color: #286090;
    border-color: #204d74;
}

.btn:active:not(:disabled) {
    background-color: #204d74;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #999;
    border-color: #999;
}

.btn-primary {
    background-color: #337ab7;
    border-color: #2e6da4;
}

.btn-primary:hover:not(:disabled) {
    background-color: #286090;
    border-color: #204d74;
}

.btn-success {
    background-color: #5cb85c;
    border-color: #4cae4c;
}

.btn-success:hover:not(:disabled) {
    background-color: #449d44;
    border-color: #398439;
}

.btn-warning {
    background-color: #f0ad4e;
    border-color: #eea236;
}

.btn-warning:hover:not(:disabled) {
    background-color: #ec971f;
    border-color: #d58512;
}

.btn-purple {
    background-color: #6c757d;
    border-color: #5a6268;
}

.btn-purple:hover:not(:disabled) {
    background-color: #5a6268;
    border-color: #4e555b;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #5a6268;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5a6268;
    border-color: #4e555b;
}

.success-message {
    text-align: center;
    color: #3c763d;
    font-size: 14px;
    font-weight: normal;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
    border-radius: 4px;
}

.success-icon {
    display: none;
}

.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
    opacity: 0;
}

.slide-fade-enter-active {
    transition: all 0.3s ease-out;
}

.slide-fade-leave-active {
    transition: all 0.3s cubic-bezier(1.0, 0.5, 0.8, 1.0);
}

.slide-fade-enter-from {
    transform: translateX(20px);
    opacity: 0;
}

.slide-fade-leave-to {
    transform: translateX(-20px);
    opacity: 0;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #555;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.processing {
    text-align: center;
    padding: 40px 0;
}

.processing-text {
    color: #333;
    font-size: 14px;
    font-weight: normal;
    margin-top: 20px;
}

.info-box {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-left: 3px solid #337ab7;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 12px;
    color: #555;
    word-break: break-all;
}

.info-box strong {
    color: #333;
}

.rules-form {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 10px;
}

.rules-form-heading {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 14px;
}

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

.form-label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
}

.form-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #337ab7;
}

.form-textarea {
    width: 100%;
    padding: 8px 10px;
    font-size: 12px;
    font-family: monospace;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    box-sizing: border-box;
}

.rule-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 6px;
    background: #fafafa;
    font-size: 13px;
}

.rule-item-info {
    flex: 1;
    min-width: 0;
}

.rule-item-name {
    font-weight: bold;
    color: #333;
}

.rule-item-docs {
    color: #888;
    font-size: 11px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rule-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 10px;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    width: auto;
    margin-bottom: 0;
}

.rules-empty {
    text-align: center;
    color: #aaa;
    font-size: 13px;
    padding: 20px 0 10px;
}

.setup-section {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.setup-status {
    font-size: 13px;
    padding: 10px 12px;
    margin-top: 5px;
    border-radius: 4px;
}

.setup-status.loading {
    color: #555;
    background: #f9f9f9;
    border: 1px solid #ddd;
}

.setup-status.success {
    color: #3c763d;
    background: #dff0d8;
    border: 1px solid #d6e9c6;
}

.setup-status.error {
    color: #a94442;
    background: #f2dede;
    border: 1px solid #ebccd1;
}

.error-message {
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    border-left: 3px solid #a94442;
    color: #a94442;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 13px;
}

.rag-filters-hint {
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
    text-align: center;
}

.raf-checklist {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
}

.raf-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    padding: 2px 0;
    word-break: break-all;
}

.raf-check-label input[type=checkbox] {
    flex-shrink: 0;
}
