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

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

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

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

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

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.counters {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
}

.counter-item {
    text-align: center;
    cursor: pointer;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    min-width: 120px;
}

.counter-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.counter-number {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.counter-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.main {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.prompt-section {
    margin-bottom: 40px;
}

.prompt-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

.prompt-input-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#promptInput {
    width: 100%;
    padding: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 15px;
    font-size: 16px;
    resize: vertical;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner.large {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

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

.results-section {
    margin-top: 40px;
}

.results-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

.table-container {
    overflow-x: auto;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

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

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
}

td {
    vertical-align: top;
}

tr:hover {
    background: #f8f9fa;
}

.neural-network-name {
    font-weight: 600;
    color: #667eea;
}

.status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status.pending {
    background: #fff3cd;
    color: #856404;
}

.status.success {
    background: #d4edda;
    color: #155724;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
}

.loading-section {
    text-align: center;
    padding: 60px 20px;
}

.loading-content p {
    margin-top: 20px;
    color: #666;
    font-size: 1.1rem;
}

.error-section {
    text-align: center;
    padding: 40px 20px;
}

.error-content p {
    color: #dc3545;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.retry-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.footer {
    text-align: center;
    color: white;
    opacity: 0.8;
}

.footer a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-decoration: underline;
}

/* Стили для страницы статистики */
.stats-nav {
    margin-top: 20px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

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

.stats-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.stats-card h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.stats-summary {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 500;
    color: #666;
}

.stat-value {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1rem;
}

.prompts-list {
    max-height: 200px;
    overflow-y: auto;
}

.prompt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.prompt-item:last-child {
    border-bottom: none;
}

.prompt-text {
    flex: 1;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

.prompt-count {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.chart-container {
    height: 180px;
    position: relative;
    margin: 0 auto;
}

/* Адаптивность для страницы статистики */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stats-card {
        padding: 20px;
    }
    
    .stat-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

.response-content {
    max-width: 600px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.response-content p {
    margin-bottom: 10px;
}

.response-content p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .main {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .counters {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    
    .counter-item {
        min-width: 100px;
        padding: 12px 16px;
    }
    
    .counter-number {
        font-size: 1.5rem;
    }
    
    .prompt-input-container {
        gap: 15px;
    }
    
    th, td {
        padding: 10px;
        font-size: 14px;
    }
    
    .response-content {
        max-width: 300px;
    }
}
