/**
 * Стили для публичного интерфейса Tender Analyzer
 */

.ta-analyzer-container {
    max-width: 1200px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    position: relative;
}

/* === Табы === */
.ta-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.ta-tab-btn {
    background: white;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.ta-tab-btn:hover {
    background: #f5f5f5;
}

.ta-tab-btn.active {
    border-bottom-color: #2271b1;
    color: #2271b1;
}

.ta-tab-content {
    display: none;
}

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

/* === Карточки === */
.ta-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ta-card h3 {
    margin-top: 0;
    color: #333;
}

.ta-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

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

.ta-form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
}

.ta-form-group input[type="text"],
.ta-form-group input[type="number"],
.ta-form-group input[type="date"] {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.ta-form-group input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

/* === Кнопки === */
.ta-btn {
    background: #2271b1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
    margin-right: 10px;
}

.ta-btn:hover {
    background: #135e96;
}

.ta-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.ta-btn-primary {
    background: #00a32a;
}

.ta-btn-primary:hover {
    background: #008a24;
}

.ta-btn-success {
    background: #46b450;
}

.ta-btn-success:hover {
    background: #00a32a;
}

/* === Результаты === */
.ta-result-box {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    display: none;
}

.ta-result-box.show {
    display: block;
}

.ta-result-success {
    background: #d5f4e6;
    border-left: 4px solid #46b450;
}

.ta-result-error {
    background: #fcf3f3;
    border-left: 4px solid #dc3232;
}

.ta-result-info {
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
}

/* === Тендеры === */
.ta-tender-item {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
}

.ta-tender-item h4 {
    margin: 0 0 10px 0;
    color: #2271b1;
}

.ta-tender-meta {
    font-size: 14px;
    color: #666;
}

.ta-tender-meta strong {
    color: #333;
}

.ta-tender-actions {
    margin-top: 10px;
}

.ta-tender-actions button {
    font-size: 12px;
    padding: 6px 12px;
}

/* === Анализ === */
.ta-analysis-score {
    font-size: 48px;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
}

.ta-analysis-score.high {
    color: #46b450;
}

.ta-analysis-score.medium {
    color: #f0a000;
}

.ta-analysis-score.low {
    color: #dc3232;
}

.ta-analysis-recommendation {
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
}

.ta-analysis-section {
    margin-bottom: 20px;
}

.ta-analysis-section h4 {
    color: #2271b1;
    margin-bottom: 10px;
}

.ta-analysis-list {
    list-style: none;
    padding: 0;
}

.ta-analysis-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.ta-analysis-list li:before {
    content: "• ";
    color: #2271b1;
    font-weight: bold;
    margin-right: 8px;
}

/* === Loading === */
.ta-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.ta-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: ta-spin 1s linear infinite;
}

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

#ta-loading-text {
    margin-top: 15px;
    font-size: 16px;
    color: #333;
}

/* === Profile Card === */
.ta-profile-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
    margin-top: 15px;
}

.ta-success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-weight: 500;
}

.ta-profile-info {
    padding: 10px;
}

.ta-profile-info h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
}

.ta-profile-info p {
    margin: 8px 0;
    line-height: 1.6;
}

.ta-profile-info strong {
    color: #34495e;
    font-weight: 600;
}

/* === Modal === */
.ta-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.ta-modal-content {
    background-color: #fefefe;
    margin: 50px auto;
    padding: 30px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.ta-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.ta-modal-close:hover,
.ta-modal-close:focus {
    color: #000;
}

.ta-profiles-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.ta-profiles-table th,
.ta-profiles-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.ta-profiles-table th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.ta-profiles-table tr:hover {
    background-color: #f9f9f9;
}

.ta-profile-actions {
    display: flex;
    gap: 8px;
}

.ta-btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

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

.ta-btn-danger:hover {
    background: #c82333;
}

.ta-btn-secondary {
    background: #6c757d;
    color: white;
}

.ta-btn-secondary:hover {
    background: #5a6268;
}

.ta-completeness-bar {
    width: 100px;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.ta-completeness-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    transition: width 0.3s;
}

/* === Responsive === */
@media (max-width: 768px) {
    .ta-tabs {
        flex-direction: column;
    }

    .ta-form-group input[type="text"],
    .ta-form-group input[type="number"],
    .ta-form-group input[type="date"] {
        max-width: 100%;
    }

    .ta-btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .ta-modal-content {
        width: 95%;
        margin: 20px auto;
    }

    .ta-profiles-table {
        font-size: 12px;
    }

    .ta-profiles-table th,
    .ta-profiles-table td {
        padding: 8px 4px;
    }
}
