/* CMS Specific Styles (add-article.php) */

.cms-editor-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 24px;
}

.cms-editor-header {
    background: #f8f9fa;
    padding: 16px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cms-editor-body {
    padding: 24px;
}

.cms-form-label {
    font-weight: 600;
    color: #4b5563;
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
}

.cms-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dce1e9;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1f2937;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.cms-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.cms-input::placeholder {
    color: #9ca3af;
}

/* Quill Editor Overrides */
.ql-toolbar.ql-snow {
    border: 1px solid #dce1e9;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    background: #f9fafb;
    padding: 12px;
}

.ql-container.ql-snow {
    border: 1px solid #dce1e9;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    background: #fff;
    height: auto;
    font-family: inherit;
    font-size: 0.95rem;
}

.ql-editor {
    min-height: 250px;
}

/* Right Panel (Preview & Tools) */
.cms-side-panel {
    position: sticky;
    top: 85px;
}

.cms-preview-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.cms-preview-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background: #f3f4f6;
    /* default bg */
    background-size: cover;
    background-position: center;
    transition: all 0.5s ease;
}

.cms-preview-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    border-radius: inherit;
}

.cms-preview-bg[style*="url("]::after {
    opacity: 1;
}

.cms-preview-card.mobile-view {
    max-width: 320px;
    margin: 0 auto;
    border-radius: 36px;
    border: 8px solid #0f172a;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    aspect-ratio: 9 / 16;
    min-height: 568px;
}

.cms-preview-card.mobile-view .cms-preview-bg {
    border-radius: 28px;
}

.cms-preview-content {
    position: relative;
    z-index: 2;
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 60%, transparent 100%);
    color: #fff;
}

.cms-preview-content.light-mode {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.4) 60%, transparent 100%);
    color: #1f2937;
}

.cms-preview-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    align-self: flex-start;
}

.cms-preview-content.light-mode .cms-preview-tag {
    background: rgba(0, 0, 0, 0.05);
}

.cms-preview-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0px;
    line-height: 1.2;
}

.cms-preview-sub {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 0px;
}

.circular-sub {
    font-size: 0.9rem;
    font-weight: 500;
}

.cms-preview-desc {
    font-size: 0.75rem;
    font-weight: 300;
    opacity: 0.9;
    margin-top: 3px;
}

.circular-preview-desc {
    font-size: 0.8rem;
    color: var(--white);
}

.cms-preview-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: clamp(0.65rem, 2.5vw, 0.75rem);
    opacity: 0.85;
}

.cms-preview-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.cms-preview-content.light-mode .cms-preview-avatar {
    border-color: rgba(0, 0, 0, 0.1);
}

.author-img-div {
    width: 46px;
    height: 46px;
    border-radius: 6px;
}

.cms-palette-box {
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-top: 20px;
}

.cms-palette-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6b7280;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.palette-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.palette-swatch:hover {
    transform: scale(1.1);
}

.palette-swatch.active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3b82f6;
}

.palette-gradient {
    border-radius: 8px;
}

.file-upload-wrapper {
    position: relative;
    width: 100%;
    height: 120px;
    border: 2px dashed #dce1e9;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload-wrapper:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 2rem;
    color: #9ca3af;
    margin-bottom: 8px;
}

.file-upload-text {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

/* Gradients Predefs */
.bg-grad-1 {
    background: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 99%, #FECFEF 100%);
}

.bg-grad-2 {
    background: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
}

.bg-grad-3 {
    background: linear-gradient(120deg, #d4fc79 0%, #96e6a1 100%);
}

.bg-grad-4 {
    background: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%);
}

.bg-grad-5 {
    background: linear-gradient(to right, #fa709a 0%, #fee140 100%);
}

.bg-grad-6 {
    background: linear-gradient(to right, #43e97b 0%, #38f9d7 100%);
}

/* Colors Predefs */
.bg-col-1 {
    background: rgb(255, 255, 255);
    border: 1px solid #eee;
}

.bg-col-2 {
    background: rgb(15, 23, 42);
}

.bg-col-3 {
    background: #059669;
}

.bg-col-4 {
    background: #d97706;
}

.bg-col-5 {
    background: #4f46e5;
}

.bg-col-6 {
    background: rgb(22, 16, 106);
}

.publish-panel {
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 24px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

/* Carousel Manager Specific Styles */
.slide-block {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

.slide-block:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
    border-color: #e2e8f0;
}

.slide-block.sortable-ghost {
    opacity: 0.5;
    background: #f8fafc;
    border: 2px dashed #3b82f6;
    box-shadow: none;
    transform: none;
}

.slide-drag-handle {
    cursor: grab;
    color: #94a3b8;
    padding: 8px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 12px;
    transition: all 0.2s;
}

.slide-drag-handle:hover {
    background: #e2e8f0;
    color: #475569;
}

.slide-drag-handle:active {
    cursor: grabbing;
}

.slide-remove-btn {
    color: #ef4444;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s;
    border-radius: 8px;
    background: #fef2f2;
}

.slide-remove-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.slide-img-preview {
    border-radius: 12px;
    object-fit: cover;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all 0.2s;
}

.slide-img-preview:hover {
    border-color: #3b82f6;
}

.slide-img-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-img-preview .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 0.75rem;
}

.slide-img-preview:hover .overlay {
    opacity: 1;
}

.slide-img-preview.slide-img-large {
    width: 160px;
    height: 160px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .slide-img-preview.slide-img-large {
        width: 100%;
        height: 180px;
    }
}

.modal-carousel-header {
    background: linear-gradient(to right, #ffffff, #f8fafc);
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 24px;
}

.modal-carousel-body {
    background: #f8fafc;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 24px 24px;
    padding: 32px 24px;
}

.modal-carousel-content {
    border-radius: 20px;
}



/* Carousel Preview Pagination */
.cms-preview-indicators {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 5;
}

.cms-preview-indicators .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cms-preview-indicators .dot.active {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.3);
}

/* Dual Banner Uploads */
.banner-upload-card {
    position: relative;
    border-radius: 12px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.banner-upload-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.15);
}

.banner-upload-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.banner-upload-card .overlay {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    padding: 10px 20px;
    border-radius: 30px;
    color: #0f172a;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.banner-upload-card:hover .overlay {
    opacity: 1;
    transform: translateY(0);
}

.banner-upload-card.empty .overlay {
    opacity: 1;
    transform: none;
    background: transparent;
    box-shadow: none;
    flex-direction: column;
    color: #64748b;
    gap: 2px;
}

.banner-upload-card.empty .overlay i {
    font-size: 1.8rem;
    color: #94a3b8;
}

.upload-card-web {
    width: 100%;
    aspect-ratio: 16 / 9;
}

.upload-card-mobile {
    width: 100%;
    aspect-ratio: 4 / 5;
    max-width: 220px;
    /* Don't let mobile get too huge on desktop */
}

/* Cropper Modal adjustments */
#cropperModal .modal-body {
    max-height: 70vh;
    overflow: hidden;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cropper-container-wrapper {
    width: 100%;
    max-height: 500px;
}

.cropper-controls {
    background: #fff;
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
}

/* Bottom Bar for Modal */
.cms-bottom-bar {
    position: sticky;
    bottom: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95) !important;
}

/* PDF Preview Card */
.pdf-preview-card {
    background-color: #212529;
    border-radius: 12px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    margin-top: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pdf-preview-card .watermark-icon {
    position: absolute;
    right: 5px;
    top: 30px;
    font-size: 80px;
    opacity: 0.05;
    color: #ffffff;
    z-index: 0;
    line-height: 1;
}

.pdf-preview-card .pdf-title {
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 1.1rem;
    word-break: break-all;
    position: relative;
    z-index: 1;
}

.pdf-preview-card .pdf-meta {
    color: #9ca3af;
    font-size: 0.8rem;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.pdf-preview-card .pdf-btn {
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    transition: all 0.2s;
}

.pdf-preview-card .pdf-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.pdf-preview-card .doc-control {
    color: #9ca3af;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pdf-preview-card .verified-badge {
    background-color: #0d6efd;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

@media (max-width: 400px) {
    .cms-preview-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* View Modal Typography */
.view-modal-long-desc p {
    margin-bottom: 1rem;
    color: #475569;
    line-height: 1.8;
}

.view-modal-long-desc ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.view-modal-long-desc li {
    margin-bottom: 0.5rem;
    color: #475569;
}

/* ================================================
   ARTICLE DETAILS BOX — Premium View Design
   ================================================ */

.article-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
    animation: fadeUp 0.4s ease both;
}

/* Tag Row */
.article-tag-row {
    margin-bottom: 12px;
}

.article-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, rgba(22, 16, 106, 0.08) 0%, rgba(22, 16, 106, 0.04) 100%);
    color: var(--primary);
    border: 1px solid rgba(22, 16, 106, 0.15);
    border-radius: 30px;
    padding: 5px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.article-tag-pill i {
    font-size: 0.8rem;
    opacity: 0.75;
}

/* Title Block */
.article-title-block {
    border-left: 4px solid var(--primary);
    padding-left: 16px;
    margin-bottom: 14px;
}

.article-main-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    line-height: 1.25;
    color: #0f0e1a;
    letter-spacing: -0.02em;
    margin: 0;
}

/* Section Label (shared) */
.article-section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-bottom: 10px;
}

.article-section-label i {
    font-size: 0.85rem;
    color: var(--primary);
    opacity: 0.6;
}

/* Short Description — clean lead paragraph */
.article-short-desc-card {
    padding: 0;
    margin-bottom: 0px;
}

.article-short-desc-card::before {
    display: none;
}

.article-short-desc-text {
    font-size: 1rem;
    color: #fff;
    line-height: 1.8;
    margin: 0;
    font-style: italic;
    letter-spacing: 0.01em;
}

/* Divider between short & long desc */
.article-content-wrapper hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, rgba(22, 16, 106, 0.18), rgba(22, 16, 106, 0.04), transparent);
    margin: 10px 0 20px;
}

/* Long Description Block */
.article-long-desc-block {
    padding: 0;
}

/* Prose content area */
.article-prose {
    color: #374151;
    line-height: 1.85;
    font-size: 0.97rem;
}

.article-prose p {
    margin-bottom: 1rem;
    color: #374151;
    line-height: 1.85;
}

.article-prose ul,
.article-prose ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.article-prose li {
    margin-bottom: 0.5rem;
    color: #475569;
}

.article-prose h1,
.article-prose h2,
.article-prose h3,
.article-prose h4 {
    font-weight: 700;
    color: #0f0e1a;
    margin-bottom: 0.5rem;
    margin-top: 1.25rem;
    line-height: 1.3;
}

.article-prose blockquote {
    border-left: 4px solid var(--primary);
    margin: 1.25rem 0;
    padding: 10px 16px;
    background: rgba(22, 16, 106, 0.04);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #4b5563;
}

.article-prose img {
    max-width: 100%;
    border-radius: 10px;
    margin: 0.75rem 0;
}

.article-prose a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Responsive tweaks */
@media (max-width: 576px) {
    .article-title-block {
        padding-left: 12px;
    }

    .article-prose {
        font-size: 0.9rem;
    }

    .modal-carousel-body {
        padding: 32px 10px;
    }
}

/* TextView Modal — Header Title */
.text-modal-header-title {
    color: #fff;
    font-weight: 800;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin: 0 0 10px;
}

/* TextView Modal — Gradient Divider */
.txt-modal-divider {
    border: none;
    height: 1px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.08), transparent);
    margin-bottom: 10px;
    margin-top: 16px;
}