/**
 * AI Portal - Кастомные стили
 *
 * @package AI_Portal
 */

/* Градиентный фон */
.gradient-bg {
    background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
}

/* Карточка промта */
.prompt-card {
    transition: all 0.3s ease;
}

.prompt-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Кнопка копирования */
.copy-btn {
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background-color: #4338ca;
}

.copy-btn.copied {
    background-color: #059669;
}

/* Карточка новости */
.news-card:hover .news-title {
    color: #4f46e5;
}

/* Typewriter эффект */
.typewriter {
    display: inline-block;
    overflow: hidden;
    border-right: .15em solid #fff;
    white-space: nowrap;
    animation: blink-caret .75s step-end infinite;
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #fff; }
}

/* Мобильное меню */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.mobile-menu.open {
    max-height: 500px;
}

/* Prose стили для контента */
.prose {
    color: #374151;
    max-width: 65ch;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
    color: #111827;
    font-weight: 700;
    line-height: 1.25;
    margin-top: 2em;
    margin-bottom: 1em;
}

.prose h1 { font-size: 2.25em; }
.prose h2 { font-size: 1.5em; }
.prose h3 { font-size: 1.25em; }
.prose h4 { font-size: 1em; }

.prose p {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
}

.prose a {
    color: #4f46e5;
    text-decoration: underline;
}

.prose a:hover {
    color: #4338ca;
}

.prose ul, .prose ol {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.625em;
}

.prose li {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.prose blockquote {
    font-style: italic;
    border-left: 4px solid #4f46e5;
    padding-left: 1em;
    margin: 1.5em 0;
    color: #6b7280;
}

.prose code {
    background-color: #f3f4f6;
    padding: 0.25em 0.5em;
    border-radius: 0.25em;
    font-size: 0.875em;
}

.prose pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 1em;
    border-radius: 0.5em;
    overflow-x: auto;
    margin: 1.5em 0;
}

.prose pre code {
    background: transparent;
    padding: 0;
}

.prose img {
    margin-top: 2em;
    margin-bottom: 2em;
    border-radius: 0.5em;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
}

.prose th, .prose td {
    border: 1px solid #e5e7eb;
    padding: 0.75em 1em;
    text-align: left;
}

.prose th {
    background-color: #f9fafb;
    font-weight: 600;
}

/* Пагинация */
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    margin: 0 4px;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination .page-numbers:hover {
    background-color: #eef2ff;
    border-color: #c7d2fe;
    color: #4f46e5;
}

.pagination .page-numbers.current {
    background-color: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}

.pagination .prev, .pagination .next {
    font-weight: 600;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Скролл-бар */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Фокус стили для доступности */
a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: #4f46e5;
    color: #fff;
    z-index: 9999;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 8px;
}

/* Line clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Формы */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="password"],
input[type="url"],
textarea,
select {
    appearance: none;
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Комментарии */
.comment-list {
    list-style: none;
    padding: 0;
}

.comment {
    padding: 1.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.comment:last-child {
    border-bottom: none;
}

.comment .comment-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.comment .comment-author img {
    border-radius: 50%;
}

.comment .comment-author .fn {
    font-weight: 600;
    color: #111827;
}

.comment .comment-meta {
    font-size: 0.875rem;
    color: #6b7280;
}

.comment .comment-content {
    color: #374151;
}

.comment .reply {
    margin-top: 0.75rem;
}

.comment .reply a {
    font-size: 0.875rem;
    color: #4f46e5;
    text-decoration: none;
}

.comment .reply a:hover {
    text-decoration: underline;
}

/* Блоки Gutenberg */
.wp-block-button__link {
    background-color: #4f46e5;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.wp-block-button__link:hover {
    background-color: #4338ca;
}

.wp-block-quote {
    border-left: 4px solid #4f46e5;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
}

.wp-block-image img {
    border-radius: 0.5rem;
}

.wp-block-gallery {
    display: grid;
    gap: 1rem;
}

.alignwide {
    margin-left: -2rem;
    margin-right: -2rem;
    max-width: calc(100% + 4rem);
}

.alignfull {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
}

/* Виджеты */
.widget ul {
    list-style: none;
    padding: 0;
}

.widget ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: #374151;
    text-decoration: none;
    transition: color 0.2s ease;
}

.widget ul li a:hover {
    color: #4f46e5;
}

/* Темный режим (опционально) */
@media (prefers-color-scheme: dark) {
    /* Можно добавить стили для темного режима */
}

/* Адаптивность */
@media (max-width: 768px) {
    .prose {
        font-size: 1rem;
    }
    
    .prose h1 { font-size: 1.75em; }
    .prose h2 { font-size: 1.375em; }
    
    .alignwide, .alignfull {
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
    }
}
