/* Custom styles for FinTechRP */

/* Typography */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #333;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 1rem;
}

.article-summary {
    color: #444;
}

/* Hero heading (used on homepage and category pages) */
.display-title {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(120deg, #0056b3, #00a0e4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
@media (max-width: 768px) {
    .display-title { font-size: 2rem; }
}

/* Article Cards */
.article-card {
    border: none;
    transition: all 0.3s ease;
    background: #fff;
    height: 100%;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

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

.card-img-top {
    height: 200px;
    object-fit: cover;
    border-top-left-radius: calc(0.375rem - 1px);
    border-top-right-radius: calc(0.375rem - 1px);
}

.article-meta {
    font-size: 0.875rem;
    color: #6c757d;
}

.article-meta i {
    margin-right: 0.25rem;
}

/* Category badges */
.category-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5em 1em;
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-transform: uppercase;
    font-size: 0.75rem;
    z-index: 2;
}

/* Featured Article */
.featured-article {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.featured-article img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.featured-article .overlay {
    background: linear-gradient(to top, 
        rgba(0,0,0,0.9) 0%,
        rgba(0,0,0,0.7) 30%,
        rgba(0,0,0,0.4) 60%,
        rgba(0,0,0,0) 100%);
    padding: 2rem;
    color: white;
}

.featured-article .overlay h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Article list UI improvements */
.article-card { overflow: hidden; border-radius: 14px; }
.article-card .card-body { padding: 1.25rem; }
.article-card .card-title a { color: #1f2937; text-decoration: none; }
.article-card .card-title a:hover { color: #0d6efd; }

/* Tag chips in card footer */
.card-footer .badge { background: rgba(0,0,0,0.05); color: #212529; border-radius: 6px; padding: 0.35rem 0.5rem; }

/* Small entrance animation for cards */
@keyframes cardFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity:1; transform: translateY(0); } }
.article-card { animation: cardFadeUp 0.45s ease both; }

/* Newsletter form */
.newsletter-form {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

/* Author card */
.author-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.author-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

/* Premium content */
.premium-badge {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Social sharing buttons */
.share-buttons {
    display: flex;
    gap: 0.5rem;
}

.share-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: opacity 0.2s;
}

.share-button:hover {
    opacity: 0.8;
}

.share-twitter { background: #1DA1F2; }
.share-facebook { background: #4267B2; }
.share-linkedin { background: #0077B5; }

/* Comments section */
.comment {
    border-left: 3px solid #dee2e6;
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.comment-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .article-card .card-img-top {
        height: 150px;
    }
}

/* Reading progress bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #f0f0f0;
    z-index: 1000;
}

.reading-progress-bar {
    height: 100%;
    background: #007bff;
    width: 0;
    transition: width 0.1s ease;
}

/* Table of contents */
.table-of-contents {
    position: sticky;
    top: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.table-of-contents ul {
    list-style: none;
    padding-left: 0;
}

.table-of-contents li {
    margin-bottom: 0.5rem;
}

.table-of-contents a {
    color: #495057;
    text-decoration: none;
}

.table-of-contents a:hover {
    color: #007bff;
}

/* Related articles */
.related-articles {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    margin-top: 3rem;
}

/* Tags cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: #e9ecef;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    color: #495057;
    text-decoration: none;
    transition: background-color 0.2s;
}

.tag:hover {
    background: #dee2e6;
    color: #212529;
}

/* Search results highlighting */
.search-highlight {
    background: #fff3cd;
    padding: 0.1rem 0.25rem;
    border-radius: 3px;
}

/* Sponsor section */
.sponsor-section {
    background: #fff;
    border: 1px solid #dee2e6;
    padding: 1rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.sponsor-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

/* Footer social icons */
footer .social-icons a {
    color: #0d6efd;
    margin-right: 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(13,110,253,0.08);
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}
footer .social-icons .bi { font-size: 1.15rem; }
footer .social-icons a:hover { color: #fff; background: #0d6efd; transform: translateY(-2px); }

/* Header social icons: match footer styles so header/footer icons look identical */
.social-link {
    color: #0d6efd;
    margin-right: 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(13,110,253,0.06);
    box-shadow: 0 2px 6px rgba(16,24,40,0.06);
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    text-decoration: none;
}
.social-link .bi {
    font-size: 1rem;
}
.social-link:hover,
.social-link:focus {
    color: #fff;
    background: #0d6efd;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 18px rgba(13,110,253,0.25);
    outline: none;
}
.social-link:focus {
    box-shadow: 0 0 0 4px rgba(13,110,253,0.15);
}

.theme-toggle-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

@media (max-width: 767px) {
    .social-link { width: 30px; height: 30px; margin-right: 0.3rem; }
    .social-link .bi { font-size: 0.9rem; }
}

@media (max-width: 767px) {
    .article-card { display: flex; flex-direction: column; }
    /* Keep footer chips visible and well spaced */
    .card-footer .badge { margin-bottom: 0.5rem; }
}
footer h5 { font-weight: 700; margin-bottom: 0.75rem; }
footer .newsletter-form .input-group .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
footer .newsletter-form .input-group .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }
footer a.text-decoration-none { color: #0d6efd; }
@media (max-width: 767px) {
    footer .text-md-end { text-align: left !important; margin-top: 1rem }
}

/* ==========================================================================
   Dark mode overrides.
   Bootstrap 5.3's own components (navbar, buttons, forms, dropdowns...)
   already respond to [data-bs-theme="dark"] on their own via CSS variables.
   These overrides are only for our custom classes and the static utility
   classes (.bg-white/.bg-light/.text-dark/.text-muted) that Bootstrap does
   NOT re-theme automatically.
   ========================================================================== */
[data-bs-theme="dark"] body {
    color: var(--bs-body-color);
}

/* Bootstrap's own bg- and text- utility classes carry !important, so
   these overrides need it too or they lose the specificity fight and
   only the text color changes while the background stays light -
   unreadable light-on-light text (this actually happened on the
   About page). */
[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-light {
    background-color: var(--bs-tertiary-bg) !important;
}
[data-bs-theme="dark"] .navbar {
    border-bottom-color: var(--bs-border-color) !important;
}
[data-bs-theme="dark"] .navbar-brand {
    color: var(--bs-primary-text-emphasis) !important;
}
[data-bs-theme="dark"] footer a.text-decoration-none {
    color: var(--bs-primary-text-emphasis);
}
[data-bs-theme="dark"] .alert-info {
    background-color: var(--bs-info-bg-subtle);
    color: var(--bs-info-text-emphasis);
}
[data-bs-theme="dark"] .nav-link {
    color: var(--bs-body-color) !important;
}
[data-bs-theme="dark"] .nav-link:hover,
[data-bs-theme="dark"] .nav-link:focus {
    color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .text-dark {
    color: var(--bs-body-color) !important;
}
[data-bs-theme="dark"] .text-muted {
    color: var(--bs-secondary-color) !important;
}

[data-bs-theme="dark"] .article-card,
[data-bs-theme="dark"] .card {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .card.border-primary {
    background-color: var(--bs-tertiary-bg);
}
[data-bs-theme="dark"] .article-card .card-title a {
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .article-summary {
    color: var(--bs-secondary-color);
}
[data-bs-theme="dark"] .category-badge {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}

[data-bs-theme="dark"] .newsletter-form,
[data-bs-theme="dark"] .author-card,
[data-bs-theme="dark"] .table-of-contents,
[data-bs-theme="dark"] .related-articles {
    background-color: var(--bs-tertiary-bg);
}
[data-bs-theme="dark"] .sponsor-section {
    background-color: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .tag,
[data-bs-theme="dark"] .card-footer .badge {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .comment {
    border-left-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .social-link,
[data-bs-theme="dark"] footer .social-icons a {
    background-color: var(--bs-tertiary-bg);
}