/* ==============================
   OpenAI Assistants - Styling
   ============================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 30px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

header h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1.1em;
    color: #666;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
    background: #f8f9ff;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Section */
.section {
    margin-bottom: 30px;
}

.section h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.section h3 {
    color: #555;
    margin-bottom: 10px;
    font-size: 1.2em;
}

/* Textarea */
textarea, input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

textarea:focus, input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

/* Assistants Grid */
.assistants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.assistant-card {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.assistant-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.assistant-card.selected {
    border-color: #667eea;
    background: #f8f9ff;
}

.assistant-card input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.assistant-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.assistant-description {
    font-size: 0.9em;
    color: #666;
}

.assistant-model {
    font-size: 0.85em;
    color: #999;
    margin-top: 5px;
}

/* Buttons */
.btn-primary, .btn-danger, .action-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

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

.action-btn {
    background: #f0f0f0;
    color: #333;
    margin-right: 10px;
    margin-bottom: 10px;
}

.action-btn.active {
    background: #667eea;
    color: white;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
    width: 0%;
}

#progress-text {
    text-align: center;
    color: #666;
    font-weight: 500;
}

/* Results */
.result-card {
    margin-bottom: 30px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.result-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #667eea;
}

.result-model {
    color: #999;
    font-size: 0.9em;
}

.result-content {
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
}

/* Statistics Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background: #f8f9ff;
    color: #667eea;
    font-weight: 600;
}

tr:hover {
    background: #fafafa;
}

/* Management */
.management-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.management-view {
    display: none;
}

.management-view.active {
    display: block;
}

.assistant-form {
    max-width: 600px;
}

.assistant-form label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.assistant-form input,
.assistant-form textarea,
.assistant-form select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
}

.assistant-form input[type="range"] {
    padding: 0;
}

.assistant-form button {
    margin-top: 20px;
}

.assistant-list-item {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    background: white;
}

.assistant-list-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 5px;
}

.assistant-list-desc {
    color: #666;
    margin-bottom: 5px;
}

.assistant-list-model {
    color: #999;
    font-size: 0.9em;
}

.warning-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    color: #856404;
    font-weight: 600;
}

/* Messages */
.message {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: 500;
}

.message.success {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
}

.message.error {
    background: #f8d7da;
    border: 2px solid #dc3545;
    color: #721c24;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .assistants-grid {
        grid-template-columns: 1fr;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-btn {
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .tab-btn.active {
        border-left-color: #667eea;
    }
}