/* Глобальные кастомные стили */
body {
    /* Фон для дорогого/богатого вида */
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    min-height: 100vh;
}

/* Красивая тень для карточек */
.card {
    border-radius: 12px;
}

/* Стилизация плейсхолдера: светлее и исчезает при фокусе */
.form-control::placeholder {
    color: #adb5bd;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.form-control:focus::placeholder {
    opacity: 0;
}

/* Эффект наведения для кнопки Telegram: белый текст */
.btn-outline-primary:hover {
    color: #fff !important;
}

/* Логотип 2Канала */
.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.brand-number {
    color: #dc3545;
    /* Красный как у ютуба, но без иконки */
    font-size: 1.8rem;
    vertical-align: middle;
}

/* Стилизация AI-контента (Markdown) */
.ai-content-area p {
    margin-bottom: 1.2rem;
    line-height: 1.7;
}

/* ── Cookie Consent Banner ────────────────────────────────── */
.policy-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 420px;
    width: calc(100% - 48px);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 24px;
    z-index: 2000;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.policy-toast.d-none {
    display: none !important;
}

.policy-toast.fade-out {
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
}

@keyframes cookieSlideIn {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.policy-toast:not(.d-none) {
    animation: cookieSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.policy-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.policy-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1d20;
    margin: 0;
}

.policy-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #495057;
    margin-bottom: 20px;
}

.policy-actions {
    display: flex;
    gap: 12px;
}

.policy-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.policy-btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.policy-btn-secondary:hover {
    background: #dee2e6;
    transform: translateY(-1px);
}

.policy-btn-primary {
    background: #0d6efd;
    color: white;
}

.policy-btn-primary:hover {
    background: #0b5ed7;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
    transform: translateY(-1px);
}

@media (max-width: 576px) {
    .policy-toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        width: auto;
        padding: 20px;
    }
    
    .policy-actions {
        flex-direction: column;
    }
}

.ai-content-area ul, .ai-content-area ol {
    margin-bottom: 1.2rem;
    padding-left: 1.5rem;
}

.ai-content-area li {
    margin-bottom: 0.6rem;
    line-height: 1.6;
}

.ai-content-area strong {
    color: #000;
    font-weight: 700;
}

/* Фикс для заголовков Markdown в Саммари */
.ai-content-area h1, .ai-content-area h2, .ai-content-area h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: #2c3e50;
}

/* ── Media Lightbox Modal Styles ──────────────────────────── */
.lightbox-modal .modal-dialog {
    max-width: 90vw !important;
    margin: 1rem auto !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding-top: 4vh !important;
    min-height: calc(100% - 2rem) !important;
}

.lightbox-modal .modal-content {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.lightbox-modal .modal-body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem !important;
    min-height: 300px;
    position: relative;
}

.lightbox-media-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-height: 87vh !important;
}

.lightbox-media-container img,
.lightbox-media-container video {
    max-width: 100%;
    max-height: 85vh !important;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    opacity: 0;
}

.lightbox-media-container img.loaded,
.lightbox-media-container video.loaded {
    opacity: 1;
}

/* Zoom animation on show */
.lightbox-modal.fade .modal-dialog {
    transform: scale(0.95);
    transition: transform 0.3s ease-out;
}

.lightbox-modal.show .modal-dialog {
    transform: scale(1);
}

/* Lightbox close button */
.lightbox-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1050;
    padding: 0;
}

.lightbox-close-btn:hover {
    background: rgba(220, 38, 38, 0.8) !important;
    border-color: rgba(220, 38, 38, 0.9) !important;
    transform: scale(1.05);
}

/* Lightbox navigation arrows */
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1040;
    user-select: none;
    padding: 0;
}

.lightbox-nav-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-50%) scale(1.05);
}

.lightbox-prev-btn {
    left: 15px;
}

.lightbox-next-btn {
    right: 15px;
}

@media (max-width: 768px) {
    .lightbox-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    .lightbox-prev-btn {
        left: 5px;
    }
    .lightbox-next-btn {
        right: 5px;
    }
    .lightbox-close-btn {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }
}

/* Hover style for clickable media in studio */
.clickable-media {
    cursor: zoom-in;
    position: relative;
}

.clickable-media::after {
    content: '\F648'; /* bootstrap icon bi-zoom-in */
    font-family: "bootstrap-icons";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(15, 23, 42, 0.75);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    opacity: 0;
    transition: all 0.25s ease;
    pointer-events: none;
    z-index: 5;
}

.clickable-media:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* PixaParser-style nav tabs */
#sourceTabs.nav-pills .nav-link {
  color: #495057;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 8px 16px;
  margin-right: 8px;
}

#sourceTabs.nav-pills .nav-link:hover {
  color: #212529;
  background-color: #e9ecef;
}

#sourceTabs.nav-pills .nav-link.active {
  color: #ffffff !important;
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
}

/* PixaParser-style cyan buttons */
.btn-outline-cyan {
  color: #0d6efd !important;
  border-color: #dee2e6 !important;
  background-color: #ffffff !important;
}

.btn-outline-cyan:hover {
  color: #ffffff !important;
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
}

.btn-cyan {
  color: #0d6efd !important;
  background-color: #ffffff !important;
  border-color: #0d6efd !important;
}

.btn-cyan:hover {
  color: #ffffff !important;
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
}

.btn-dl-dark {
  color: #212529 !important;
  background-color: transparent !important;
  border: none !important;
}

.btn-dl-dark:hover {
  background-color: #ffffff !important;
  color: #6c757d !important;
}