* {
    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, #0ba360 0%, #3cba92 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* Центрированное состояние */
.search-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    transition: all 0.5s ease;
}

.search-wrapper.has-results {
    min-height: auto;
    padding: 60px 0 40px;
}

.search-box {
    width: 100%;
    max-width: 1000px;
    transition: all 0.5s ease;
}

.search-wrapper.has-results .search-box {
    max-width: 100%;
}

.search-box h1 {
    display: none;
}

.search-form {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 24px 70px 24px 30px;
    border: none;
    border-radius: 60px;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #0ba360 0%, #3cba92 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 5px 15px rgba(11, 163, 96, 0.4);
}

.search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.search-btn svg {
    width: 22px;
    height: 22px;
}

/* Прелоадер */
.loader {
    display: none;
    text-align: center;
    margin-top: 30px;
}

.loader.active {
    display: block;
}

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

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

.loader-text {
    color: white;
    font-size: 16px;
    font-weight: 500;
}

/* Информация о компании */
.company-info {
    display: none;
    background: white;
    border-radius: 20px;
    padding: 25px 35px;
    margin-top: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.company-info.active {
    display: block;
}

.company-info h2 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1.8em;
}

.company-info p {
    color: #666;
    margin: 5px 0;
    font-size: 1.1em;
}

/* Результаты */
.results {
    display: none;
    margin-top: 30px;
}

.results.active {
    display: block;
}

.chart-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.chart-section h3 {
    color: #333;
    margin-bottom: 30px;
    font-size: 1.6em;
    font-weight: 600;
}

.summary-chart-wrapper {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.chart-container {
    flex: 1;
    width: 100%;
    min-height: 760px;
    max-width: 100%;
}

.chart-controls {
    width: 280px;
    min-width: 280px;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
}

.chart-controls h4 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.1em;
}

.checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.checkbox-item:hover {
    background: white;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #0ba360;
}

.checkbox-item label {
    cursor: pointer;
    font-size: 15px;
    color: #555;
}

.detail-chart {
    margin-bottom: 50px;
}

.detail-chart h4 {
    color: #0ba360;
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 600;
}

.error-message {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    color: #c33;
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    text-align: center;
    font-size: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.error-message.active {
    display: block;
}

@media (max-width: 768px) {
    .summary-chart-wrapper {
        flex-direction: column;
    }
    
    .chart-controls {
        width: 100%;
    }
    
    .search-input {
        padding: 18px 60px 18px 20px;
        font-size: 16px;
    }
    
    .search-btn {
        width: 45px;
        height: 45px;
    }
    
    .search-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .company-info h2 {
        font-size: 1.4em;
    }
    
    .company-info p {
        font-size: 1em;
    }
    
    .chart-section {
        padding: 20px;
    }
    
    .chart-section h3 {
        font-size: 1.3em;
    }
    
    .export-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .export-btn svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .search-wrapper.has-results {
        padding: 30px 0 20px;
    }
    
    .search-input {
        padding: 16px 55px 16px 18px;
        font-size: 15px;
    }
    
    .search-btn {
        width: 42px;
        height: 42px;
        right: 6px;
    }
    
    .company-info {
        padding: 18px 20px;
    }
    
    .company-info h2 {
        font-size: 1.2em;
        margin-bottom: 6px;
    }
    
    .company-info p {
        font-size: 0.9em;
    }
    
    .chart-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .chart-section h3 {
        font-size: 1.1em;
        margin-bottom: 20px;
    }
    
    .summary-chart-wrapper {
        gap: 20px;
    }
    
    .chart-container {
        min-height: 300px;
    }
    
    .chart-controls {
        padding: 15px;
    }
    
    .chart-controls h4 {
        font-size: 1em;
        margin-bottom: 15px;
    }
    
    .checkbox-item {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .checkbox-item label {
        font-size: 13px;
    }
    
    .detail-chart h4 {
        font-size: 1.1em;
    }
    
    .export-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
}

.company-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0ba360 0%, #3cba92 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(11, 163, 96, 0.4);
}

.export-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.export-btn svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    .company-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .export-btn {
        width: 100%;
        justify-content: center;
    }
}
