* {
    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;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.card {
    background: white;
    margin-bottom: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

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

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

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

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.status-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.status-item {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-item:last-child {
    margin-bottom: 0;
}

.token-display {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
    word-break: break-all;
    font-size: 12px;
}

.chat-container {
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    overflow: hidden;
}

.chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #e1e5e9;
}

.chat-input {
    display: flex;
    padding: 20px;
    gap: 15px;
    align-items: center;
    background: white;
}

.chat-input input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
}

.chat-input input:focus {
    outline: none;
    border-color: #667eea;
}

.chat-buttons {
    display: flex;
    gap: 10px;
}

.rag-options {
    padding: 20px;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-bottom: 2px solid #e1e5e9;
}

.history-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: end;
    flex-wrap: wrap;
}

.history-controls .form-group {
    margin-bottom: 0;
    min-width: 120px;
}

.history-container {
    max-height: 400px;
    overflow-y: auto;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e1e5e9;
}

.org-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.org-form {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e1e5e9;
}

.org-form h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.result-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e1e5e9;
    min-height: 100px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 13px;
    line-height: 1.5;
}

.feedback-textarea {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    background: #f8f9fa;
    resize: vertical;
}

.feedback-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.message {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 10px;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #28a745;
    margin-left: 20px;
}

.message.assistant {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-left: 4px solid #17a2b8;
    margin-right: 20px;
}

.message.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.streaming {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%) !important;
    border-left: 4px solid #ffc107 !important;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .org-grid {
        grid-template-columns: 1fr;
    }
    
    .chat-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .chat-buttons {
        justify-content: center;
    }
    
    .history-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .history-controls .form-group {
        min-width: auto;
    }
    
    .button-group {
        justify-content: center;
    }
    
    .card-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* Progress Bar Styles */
.progress-container {
    margin: 20px 0;
    max-width: 100%;
}

.progress-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-left: 4px solid #2196f3;
    transition: all 0.3s ease;
}

.progress-item.active {
    border-left-color: #2196f3;
    animation: pulse 2s infinite;
}

.progress-item.completed {
    border-left-color: #4caf50;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
}

.progress-item.error {
    border-left-color: #f44336;
    background: linear-gradient(135deg, #fff8f8 0%, #fde8e8 100%);
}

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

.filename {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.stage {
    font-size: 12px;
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.progress-item.completed .stage {
    background: #e8f5e9;
    color: #388e3c;
}

.progress-item.error .stage {
    background: #ffebee;
    color: #d32f2f;
}

.progress-bar-container {
    position: relative;
    background: #f0f0f0;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2196f3, #21cbf3);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-item.completed .progress-bar {
    background: linear-gradient(90deg, #4caf50, #66bb6a);
}

.progress-item.error .progress-bar {
    background: linear-gradient(90deg, #f44336, #ef5350);
}

.progress-text {
    position: absolute;
    right: 0;
    top: -20px;
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

.progress-message {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    50% {
        box-shadow: 0 6px 20px rgba(33, 150, 243, 0.3);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
}

/* Animasyonlu progress bar */
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-item.completed .progress-bar::after,
.progress-item.error .progress-bar::after {
    display: none;
}

/* Responsive progress bars */
@media (max-width: 768px) {
    .progress-item {
        padding: 12px;
    }
    
    .progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .filename {
        font-size: 13px;
    }
    
    .stage {
        font-size: 11px;
    }
} 