/* css/blog.css */

/* PUBLIC BLOG STYLING */

/* Skeleton Loader for dynamic content */
.skeleton-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}
.skeleton-img {
    height: 200px;
    background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
    background-size: 200% 100%;
    animation: loading-pulse 1.5s infinite;
}
.skeleton-text {
    height: 15px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
    background-size: 200% 100%;
    animation: loading-pulse 1.5s infinite;
}
.skeleton-text.title {
    height: 24px;
    width: 80%;
    margin-bottom: 15px;
}
.skeleton-text.excerpt {
    width: 95%;
}
.skeleton-text.button {
    height: 35px;
    width: 100px;
    margin-top: 15px;
}

@keyframes loading-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Tryb Ciemny dla skeletonów */
@media (prefers-color-scheme: dark) {
    .skeleton-img, .skeleton-text {
        background: linear-gradient(90deg, #1b1b1d 25%, #2a2a2d 50%, #1b1b1d 75%) !important;
        background-size: 200% 100% !important;
    }
}

/* Swiper news carousel customization */
.news-carousel-container {
    padding: 10px 0 75px 0 !important;
}
.news-carousel-container .swiper-pagination {
    bottom: 25px !important;
}
.news-carousel-container .swiper-pagination-bullet-active {
    background: var(--primary-color) !important;
}

/* Blog Cards */
.blog-card {
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(190, 30, 45, 0.15);
}
.blog-card-img-wrapper {
    position: relative;
    overflow: hidden;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #eaeaea;
}
.blog-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.blog-card:hover .blog-card-img {
    transform: scale(1.06);
}
.blog-card-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(190, 30, 45, 0.3);
}
.blog-card-pinned {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ffc107;
    color: #000;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(255, 193, 7, 0.3);
}
.blog-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.blog-card-meta {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
}
.blog-card-meta i {
    color: var(--primary-color);
}
.blog-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
    color: var(--text-color);
}
.blog-card-title a {
    color: inherit;
}
.blog-card-title a:hover {
    color: var(--primary-color);
}
.blog-card-excerpt {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius-md);
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}
.sidebar-widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg-alternate);
    position: relative;
}
.sidebar-widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-color);
}
.category-list, .recent-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.category-list li {
    margin-bottom: 12px;
}
.category-list li:last-child {
    margin-bottom: 0;
}
.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 0;
    transition: var(--transition-smooth);
}
.category-link:hover {
    color: var(--primary-color);
    padding-left: 5px;
}
.category-count {
    background: var(--bg-alternate);
    color: var(--text-color);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag-badge {
    background: var(--bg-alternate);
    color: var(--text-color);
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    transition: var(--transition-smooth);
}
.tag-badge:hover {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 10px rgba(190, 30, 45, 0.2);
}

/* Recent Posts Sidebar */
.recent-post-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}
.recent-post-item:last-child {
    margin-bottom: 0;
}
.recent-post-img-wrapper {
    width: 65px;
    height: 65px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #eaeaea;
}
.recent-post-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.recent-post-content {
    display: flex;
    flex-direction: column;
}
.recent-post-title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.recent-post-date {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Pagination */
.blog-pagination .page-link {
    color: var(--text-color);
    background: var(--card-bg);
    border-color: var(--bg-alternate);
    border-radius: 6px;
    margin: 0 3px;
    font-weight: 600;
    transition: var(--transition-smooth);
}
.blog-pagination .page-link:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
.blog-pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
.blog-pagination .page-item.disabled .page-link {
    background: var(--bg-alternate);
    border-color: var(--bg-alternate);
}

/* Breadcrumbs Custom styles */
.blog-breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 25px;
}
.blog-breadcrumb .breadcrumb-item a {
    color: var(--text-color);
    font-weight: 500;
}
.blog-breadcrumb .breadcrumb-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* SINGLE ARTICLE VIEW */
.blog-post-detail {
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}
@media (max-width: 768px) {
    .blog-post-detail {
        padding: 20px;
        border-radius: var(--border-radius-md);
    }
}
.article-header {
    margin-bottom: 30px;
}
.article-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-color);
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--bg-alternate);
}
.article-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}
.article-meta i {
    color: var(--primary-color);
}
.article-main-image-wrapper {
    border-radius: var(--border-radius-md);
    overflow: hidden;
    margin-bottom: 35px;
    box-shadow: var(--shadow-md);
}
.article-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-color);
}
.article-body h2, .article-body h3, .article-body h4 {
    color: var(--text-color);
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 15px;
}
.article-body p {
    margin-bottom: 20px;
}
.article-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 15px 25px;
    margin: 30px 0;
    background: var(--bg-alternate);
    font-style: italic;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}
.article-body ul, .article-body ol {
    margin-bottom: 25px;
    padding-left: 20px;
}
.article-body li {
    margin-bottom: 8px;
}

/* Redesigned Premium Social Share Widget */
.share-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 24px 0;
    margin-top: 40px;
    border-top: 1px solid var(--bg-alternate);
    border-bottom: 1px solid var(--bg-alternate);
}
.share-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.share-btn-premium {
    text-decoration: none !important;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 30px;
    border: 1px solid var(--bg-alternate);
    background: var(--card-bg);
    color: var(--text-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}
.share-btn-premium i {
    font-size: 0.95rem;
}
.share-btn-premium .share-btn-text {
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}
.share-btn-premium.fb {
    border-color: rgba(24, 119, 242, 0.25);
    color: #1877f2;
}
.share-btn-premium.fb:hover {
    background: #1877f2;
    border-color: #1877f2;
    color: #ffffff !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(24, 119, 242, 0.25);
}
.share-btn-premium.fb:hover i {
    color: #ffffff !important;
}
.share-btn-premium.tw {
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text-color);
}
@media (prefers-color-scheme: dark) {
    .share-btn-premium.tw {
        border-color: rgba(255, 255, 255, 0.2);
    }
}
.share-btn-premium.tw:hover {
    background: #000000;
    border-color: #000000;
    color: #ffffff !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}
.share-btn-premium.tw:hover i {
    color: #ffffff !important;
}
.share-btn-premium.ln {
    border-color: rgba(0, 119, 181, 0.25);
    color: #0077b5;
}
.share-btn-premium.ln:hover {
    background: #0077b5;
    border-color: #0077b5;
    color: #ffffff !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 119, 181, 0.25);
}
.share-btn-premium.ln:hover i {
    color: #ffffff !important;
}
.share-btn-premium.link {
    border-color: rgba(190, 30, 45, 0.25);
    color: #be1e2d;
}
.share-btn-premium.link:hover {
    background: #be1e2d;
    border-color: #be1e2d;
    color: #ffffff !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(190, 30, 45, 0.25);
}
.share-btn-premium.link:hover i {
    color: #ffffff !important;
}

/* Premium Reading Progress Bar & Toast Notification */
#read-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--primary-color);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s ease;
}
#toast-message {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    font-weight: 600;
    font-size: 0.9rem;
    animation: fade-in-up 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Swiper news pagination premium enhancement */
.news-carousel-container .swiper-pagination-bullet {
    background: #ccc !important;
    opacity: 1 !important;
    transition: all 0.3s ease !important;
    width: 10px !important;
    height: 10px !important;
}
.news-carousel-container .swiper-pagination-bullet-active {
    background: var(--primary-color) !important;
    width: 28px !important;
    border-radius: 5px !important;
}

/* Dark CTA Widget Contrast Correction */
.sidebar-widget.bg-dark,
.sidebar-widget.bg-dark h1,
.sidebar-widget.bg-dark h2,
.sidebar-widget.bg-dark h3,
.sidebar-widget.bg-dark h4,
.sidebar-widget.bg-dark h5,
.sidebar-widget.bg-dark h6,
.sidebar-widget.bg-dark p,
.sidebar-widget.bg-dark span,
.sidebar-widget.bg-dark i {
    color: #ffffff !important;
}
.sidebar-widget.bg-dark .text-muted,
.sidebar-widget.bg-dark p.text-muted,
.sidebar-widget.bg-dark span.text-muted {
    color: #cbd5e1 !important; /* Jasnoszary kolor dla doskonałego kontrastu na ciemnym tle */
}

/* Gallery Grid */
.article-gallery {
    margin: 40px 0;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}
.gallery-item {
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    position: relative;
    padding-top: 75%; /* 4:3 ratio */
}
.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

/* CMS ADMIN STYLING */
.admin-login-card {
    max-width: 420px;
    margin: 100px auto;
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.admin-login-header {
    background: var(--topbar-bg);
    color: #fff;
    padding: 30px;
    text-align: center;
}
.admin-login-logo {
    max-width: 120px;
    margin-bottom: 15px;
}
.admin-login-body {
    padding: 30px;
}

/* Admin Dashboard */
.admin-navbar {
    background: var(--topbar-bg) !important;
}
.admin-container {
    padding: 40px 0;
}
.admin-card {
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    padding: 25px;
    margin-bottom: 30px;
}
.admin-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Quill Editor Overrides */
.ql-container {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 0.95rem !important;
    min-height: 300px;
    border-radius: 0 0 8px 8px;
    background: var(--card-bg);
}
.ql-toolbar {
    border-radius: 8px 8px 0 0;
    background: var(--bg-alternate);
}

/* Media Uploader Box */
.image-upload-dropzone {
    border: 2px dashed rgba(190, 30, 45, 0.3);
    border-radius: var(--border-radius-md);
    padding: 30px;
    text-align: center;
    background: rgba(190, 30, 45, 0.01);
    cursor: pointer;
    transition: var(--transition-smooth);
}
.image-upload-dropzone:hover {
    border-color: var(--primary-color);
    background: rgba(190, 30, 45, 0.03);
}
.image-preview-thumbnail {
    width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}
.gallery-previews-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}
.gallery-preview-item {
    position: relative;
    width: 80px;
    height: 60px;
}
.gallery-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}
.gallery-preview-item .remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
}

/* Admin lists table */
.admin-table th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: #6c757d;
    border-bottom: 2px solid var(--bg-alternate);
}
.admin-table td {
    vertical-align: middle;
    font-size: 0.9rem;
}
.badge-status-published {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}
.badge-status-draft {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Swiper news pagination mobile spacing fix */
@media (max-width: 768px) {
    .news-carousel-container {
        padding-bottom: 65px !important;
    }
    .news-carousel-container .swiper-pagination {
        bottom: 15px !important;
    }
}

/* Blog Card Read More Button animations */
.blog-card .btn-outline-danger {
    border-radius: 30px;
    padding: 6px 20px;
    transition: all 0.3s ease;
}
.blog-card .btn-outline-danger i {
    transition: transform 0.3s ease;
    display: inline-block;
}
.blog-card .btn-outline-danger:hover i {
    transform: translateX(4px);
}
