/* assets/css/components.css - Дополнительные стили */

/* Модальные окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
}

.modal-container {
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    background: var(--secondary-dark);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-container.small {
    width: 400px;
}

.modal-container.medium {
    width: 600px;
}

.modal-container.large {
    width: 900px;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.modal-content {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Уведомления */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.notification {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.notification.show {
    transform: translateX(0);
}

.notification.hide {
    transform: translateX(120%);
}

.notification-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification.success .notification-icon {
    color: var(--success);
}

.notification.error .notification-icon {
    color: var(--danger);
}

.notification.warning .notification-icon {
    color: var(--warning);
}

.notification.info .notification-icon {
    color: var(--accent-blue);
}

.notification-content {
    flex: 1;
}

.notification-message {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.notification-close:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-blue-light));
    animation: progress 5s linear;
}

@keyframes progress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Комментарии */
.comments-section {
    margin-top: 30px;
}

.comment-item {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 12px;
    background: var(--glass-bg);
    display: flex;
    gap: 15px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.comment-item.show {
    transform: translateY(0);
    opacity: 1;
}

.comment-item.hide {
    transform: translateY(-20px);
    opacity: 0;
}

.comment-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent-blue);
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 600;
    color: var(--accent-blue);
    text-decoration: none;
}

.comment-author:hover {
    text-decoration: underline;
}

.comment-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.comment-pending {
    background: var(--warning);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 10px;
}

.comment-text {
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 10px;
    word-break: break-word;
}

.comment-actions {
    display: flex;
    gap: 10px;
}

.comment-action {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.comment-action:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.comment-action.active {
    color: var(--accent-blue);
}

.comment-action.like-btn.active {
    color: var(--accent-blue);
}

.comment-action.delete-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.comment-action.report-btn:hover {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

/* Форма комментария */
.comment-form {
    margin-bottom: 30px;
}

.comment-textarea {
    width: 100%;
    padding: 15px;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    min-height: 100px;
    resize: vertical;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.1);
}

/* Результаты поиска */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--secondary-dark);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-top: 5px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.search-results.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-group {
    padding: 10px;
}

.search-group-title {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 10px;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-item:hover,
.search-item.selected {
    background: var(--glass-bg);
}

.search-item-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.search-item-info {
    flex: 1;
}

.search-item-title {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 2px;
}

.search-item-title mark {
    background: var(--accent-blue);
    color: white;
    padding: 0 2px;
    border-radius: 2px;
}

.search-item-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.search-loader {
    padding: 20px;
    display: flex;
    justify-content: center;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 10px;
}

/* Загрузчик */
.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Анимации для появления при скролле */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Кастомный скроллбар для результатов поиска */
.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: var(--glass-bg);
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 3px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .modal-container.small,
    .modal-container.medium,
    .modal-container.large {
        width: 95%;
    }
    
    .notification-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .comment-actions {
        flex-wrap: wrap;
    }
}

/* Темная тема (уже используется) */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-dark: #0a0f1e;
        --secondary-dark: #141b2b;
    }
}

/* Стили для кнопки редакторской панели */
.editor-link {
    position: relative;
    color: #f59e0b !important; /* Оранжевый цвет */
    font-weight: 500;
}

.editor-link::before {
    content: '⚡';
    margin-right: 4px;
    font-size: 1.1rem;
}

.editor-link:hover {
    color: #fbbf24 !important; /* Светло-оранжевый при наведении */
}

/* Можно добавить анимацию */
@keyframes editor-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.editor-link {
    animation: editor-pulse 2s infinite;
}