/* css/api-styles.css - Дополнительные стили для API интеграции */

/* ========================================
   СТИЛИ ДЛЯ ФОРМЫ ПРОВЕРКИ ПК
   ======================================== */

.pc-check-section {
    margin: 60px 0;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.section-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.section-description {
    text-align: center;
    font-size: 18px;
    color: #64748b;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.pc-check-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.form-group label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #FF844B;
    box-shadow: 0 0 0 3px rgba(255, 132, 75, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #FF844B 0%, #e74c3c 100%);
    color: white;
    padding: 16px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 20px auto 0;
    display: block;
    min-width: 200px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 132, 75, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

/* Автодополнение */
.hardware-suggestions {
    background: rgba(255, 255, 255, 1) !important;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 99999 !important;
    position: absolute !important;
    left: 0;
    right: 0;
    top: 86%;
    margin-top: 4px;
}


.suggestion-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.4;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: #f8fafc;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Адаптивность */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .section-description {
        font-size: 16px;
    }
    
    .pc-check-section {
        margin: 40px 0;
        padding: 30px 15px;
    }
}

/* ========================================
   СТИЛИ ДЛЯ РЕЗУЛЬТАТОВ ПРОВЕРКИ ПК
   ======================================== */

.result-message {
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
    animation: fadeIn 0.3s ease-out;
}

.result-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 2px solid #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.result-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fef7f7 100%);
    border: 2px solid #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.result-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.compatibility-score {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.compatibility-score.high {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.compatibility-score.medium {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.compatibility-score.low {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.result-content {
    line-height: 1.6;
}

.course-info {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    border-left: 4px solid #3b82f6;
}

.recommendation {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border-left: 4px solid #10b981;
}

.hardware-summary {
    margin-bottom: 20px;
}

.hardware-summary h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #374151;
}

.hardware-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hardware-summary li {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    border-left: 3px solid #6b7280;
    transition: border-color 0.2s ease;
}

.hardware-summary li:hover {
    border-left-color: #3b82f6;
}

.result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.error-header h3 {
    color: #dc2626;
}

.error-message {
    font-size: 16px;
    color: #7f1d1d;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
}

.error-actions {
    margin-top: 16px;
}

/* ========================================
   УЛУЧШЕНИЯ ДЛЯ ФОРМЫ ПРОВЕРКИ ПК
   ======================================== */

.pc-form .form-group,
.pc-check-form .form-group {
    position: relative;
    margin-bottom: 24px;
}

.pc-form label,
.pc-check-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.pc-form input,
.pc-form select,
.pc-check-form input,
.pc-check-form select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.2s ease;
    background: white;
}

.pc-form select option,
.pc-check-form select option {
    font-weight: 400;
    font-size: 14px;
    padding: 12px 16px;
    background: white;
    border: none;
    color: #374151;
    line-height: 1.4;
}

.pc-form select option:hover,
.pc-check-form select option:hover {
    background: #f8fafc;
}

.pc-form select option:checked,
.pc-check-form select option:checked {
    background: #e8f4f8;
    color: #1976d2;
}

/* Стилизация выпадающего списка select */
.pc-form select,
.pc-check-form select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Улучшенные стили focus и hover */
.pc-form input:focus,
.pc-form select:focus,
.pc-check-form input:focus,
.pc-check-form select:focus {
    outline: none;
    border-color: #FF844B;
    box-shadow: 0 2px 12px rgba(255, 132, 75, 0.15), 0 0 0 3px rgba(255, 132, 75, 0.1);
}

.pc-form select:hover,
.pc-check-form select:hover {
    border-color: #9ca3af;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pc-form input.error,
.pc-form select.error,
.pc-check-form input.error,
.pc-check-form select.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-message {
    display: none;
    color: #dc2626;
    font-size: 13px;
    margin-top: 6px;
    padding: 4px 8px;
    background: #fef2f2;
    border-radius: 4px;
    border-left: 3px solid #ef4444;
}

.help-text {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    font-style: italic;
}

.check-btn {
    position: relative;
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}


.check-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-text {
    display: block;
}

.btn-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   УЛУЧШЕНИЯ ДЛЯ КНОПОК ПРОГРАММ
   ======================================== */

.instruction-card .btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.instruction-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.instruction-card .btn:active {
    transform: translateY(0);
}

.instruction-card .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.instruction-card:hover .btn::before {
    left: 100%;
}

/* ========================================
   УВЕДОМЛЕНИЯ
   ======================================== */

.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

.notification {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    min-width: 320px;
    max-width: 400px;
    pointer-events: auto;
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

.notification-success {
    border-left: 4px solid #10b981;
    background: rgba(255, 255, 255, 0.95);
}

.notification-error {
    border-left: 4px solid #ef4444;
    background: rgba(255, 255, 255, 0.95);
}

.notification-warning {
    border-left: 4px solid #f59e0b;
    background: rgba(255, 255, 255, 0.95);
}

.notification-info {
    border-left: 4px solid #3b82f6;
    background: rgba(255, 255, 255, 0.95);
}

.notification-content {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    gap: 12px;
}

.notification-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.notification-text {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #1f2937;
    font-size: 14px;
}

.notification-message {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
    word-wrap: break-word;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.notification-close:hover {
    color: #4b5563;
}

@keyframes slideIn {
    from {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   АДАПТИВНОСТЬ
   ======================================== */

@media (max-width: 768px) {
    .notifications-container {
        left: 10px;
        right: 10px;
        top: 10px;
    }
    
    .notification {
        min-width: auto;
        max-width: none;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions .btn {
        width: 100%;
    }
    
    .pc-form input,
    .pc-form select,
    .pc-check-form input,
    .pc-check-form select {
        font-size: 16px; /* Предотвращает зум на мобильных */
    }
}

@media (max-width: 480px) {
    .notification-content {
        padding: 12px 16px;
    }
    
    .notification-title {
        font-size: 13px;
    }
    
    .notification-message {
        font-size: 12px;
    }
    
    .check-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* ========================================
   ТЕМНАЯ ТЕМА (ОПЦИОНАЛЬНО)
   ======================================== */

@media (prefers-color-scheme: dark) {
    .result-success {
        background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
        border-color: #10b981;
        color: #d1fae5;
    }
    
    .result-error {
        background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
        border-color: #ef4444;
        color: #fecaca;
    }
    
    .notification {
        background: rgba(31, 41, 55, 0.95);
        color: #f9fafb;
    }
    
    .notification-title {
        color: #f9fafb;
    }
    
    .notification-message {
        color: #d1d5db;
    }
}

/* ========================================
   АНИМАЦИИ ДЛЯ ЗАГРУЗКИ
   ======================================== */

.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #6b7280;
}

.loading-placeholder .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    margin-bottom: 12px;
}

.loading-placeholder p {
    margin: 0;
    font-size: 14px;
}

/* ========================================
   УЛУЧШЕНИЯ ДОСТУПНОСТИ
   ======================================== */

.check-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.notification:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ========================================
   АНИМАЦИИ ДЛЯ ОСНОВНЫХ БЛОКОВ
   ======================================== */

/* Анимации появления блоков */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

/* Анимации для основных блоков страницы */
.main-title {
    animation: fadeInUp 0.6s ease-out;
}

.instructions-grid {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

/* Анимация для блока "Проверка ПК" */
.check-computer {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* Анимация для блока "Технические характеристики" */
.requirements {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

/* Анимация для раскрывающихся блоков требований */
.requirement-details {
    animation: slideDown 0.4s ease-out;
    overflow: hidden;
}

.sub-requirement-details {
    animation: slideDown 0.3s ease-out;
    overflow: hidden;
}

/* Плавные переходы для интерактивных элементов */
.requirement-item,
.sub-requirement-item {
    transition: all 0.3s ease;
}

.requirement-item:hover,
.sub-requirement-item:hover {
    cursor: pointer;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Анимация для кнопки "Проверить" */
.check-btn {
    transition: all 0.3s ease;
}

.check-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 132, 75, 0.3);
}

/* Анимация для полей формы */
.pc-form .form-group {
    animation: fadeInUp 0.6s ease-out;
}

.pc-form .form-group:nth-child(1) { animation-delay: 0.1s; }
.pc-form .form-group:nth-child(2) { animation-delay: 0.2s; }
.pc-form .form-group:nth-child(3) { animation-delay: 0.3s; }
.pc-form .form-group:nth-child(4) { animation-delay: 0.4s; }

/* Анимации для карточек программ */
.instruction-card {
    transition: all 0.3s ease;
}

.instruction-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Для пользователей, которые предпочитают сниженную анимацию */
@media (prefers-reduced-motion: reduce) {
    .notification,
    .result-message,
    .spinner,
    .check-btn,
    .instruction-card .btn,
    .main-title,
    .instructions-grid,
    .instruction-card,
    .check-computer,
    .requirements,
    .requirement-details,
    .sub-requirement-details,
    .pc-form .form-group {
        animation: none;
        transition: none;
    }
    
    .check-btn:hover,
    .instruction-card .btn:hover,
    .instruction-card:hover,
    .requirement-item:hover,
    .sub-requirement-item:hover {
        transform: none;
    }
}