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

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Левая колонка - панель управления */
.left-panel {
    flex: 1;
    padding: 20px;
    border-right: 1px solid #ddd;
    background-color: #fafafa;
    overflow-y: auto;
    max-width: 500px;
}

.left-panel h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 24px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.left-panel h3 {
    margin-bottom: 15px;
    color: #34495e;
    font-size: 18px;
    margin-top: 25px;
}

/* Секции */
.auth-section,
.api-buttons-section,
.message-section,
.file-section {
    margin-bottom: 30px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Формы */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
    font-size: 14px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

/* Кнопки */
.api-button {
    width: 100%;
    padding: 12px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.api-button:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.api-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Правая колонка - вывод ответа API */
.right-panel {
    flex: 1.5;
    padding: 20px;
    background-color: #fff;
    display: flex;
    flex-direction: column;
}

.right-panel h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 24px;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 10px;
}

.response-area {
    flex: 1;
    background-color: #2d3748;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

#responseContent {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Демо-индикатор */
.mode-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 20px;
    text-align: center;
    font-size: 14px;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.mode-badge {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
}

.mode-info {
    opacity: 0.9;
}

.container {
    margin-top: 60px; /* Отступ для mode-indicator */
}

/* Демо-футер */
.demo-footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
}

.demo-footer p {
    margin: 5px 0;
    opacity: 0.9;
}

.demo-footer a {
    color: white;
    text-decoration: underline;
    font-weight: bold;
}

.demo-footer a:hover {
    opacity: 0.8;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        margin-top: 60px;
    }
    
    .left-panel {
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    
    .right-panel {
        min-height: 400px;
    }
    
    .response-area {
        max-height: 300px;
    }
    
    .mode-indicator {
        flex-direction: column;
        gap: 5px;
        padding: 10px;
    }
    
    .demo-footer {
        padding: 15px;
        font-size: 14px;
    }
}

/* Анимация загрузки */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.api-button.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Успешное и ошибочное состояние */
.success {
    background-color: #27ae60 !important;
}

.error {
    background-color: #e74c3c !important;
}

/* Индикатор состояния API */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    background-color: #95a5a6;
}

.status-indicator.authorized {
    background-color: #27ae60;
}

.status-indicator.not-authorized {
    background-color: #e74c3c;
}

.status-indicator.starting {
    background-color: #f39c12;
    animation: pulse 2s infinite;
}

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