/**
 * assets/css/components.css
 * Bootstrap 4 Custom Components cho GeneratePress Child Theme
 */

/* ================================================
   BACK TO TOP BUTTON
   ================================================ */

#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1050;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.5);
}

/* ================================================
   HEADER SCROLLED EFFECT
   ================================================ */

.site-header.scrolled {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    background-color: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
}

/* ================================================
   HERO SECTION
   ================================================ */

.hero-section {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 420px;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.35) 100%);
}

/* ================================================
   CARD HOVER EFFECTS
   ================================================ */

.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 0.5rem !important;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

.card-img-top {
    transition: transform 0.35s ease;
}

.card:hover .card-img-top {
    transform: scale(1.04);
}

/* ================================================
   TOAST CONTAINER
   ================================================ */

#toast-container {
    max-width: 350px;
}

/* ================================================
   CATEGORY LINKS
   ================================================ */

.card-categories .cat-links a,
.card-categories a {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2em 0.65em;
    background-color: #e7f1ff;
    color: #007bff;
    border-radius: 3px;
    text-decoration: none;
    font-weight: 600;
}

.card-categories a:hover {
    background-color: #007bff;
    color: #fff;
}

/* ================================================
   GAP UTILITY (Bootstrap 4 chưa có)
   ================================================ */

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem;  }
.gap-3 { gap: 1rem;    }

/* ================================================
   BREADCRUMB
   ================================================ */

.breadcrumb {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    padding: 0.6rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    color: #6c757d;
}

.breadcrumb-item a {
    color: #007bff;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* ================================================
   TABLE RESPONSIVE FIX
   ================================================ */

.table-responsive {
    border-radius: 0.375rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #343a40;
    color: #ffffff;
    border-color: #454d55;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ================================================
   SOCIAL SHARE BUTTONS
   ================================================ */

.social-share {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.social-share a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    color: #fff;
    transition: opacity 0.2s ease;
}

.social-share a:hover {
    opacity: 0.85;
    color: #fff;
}

.social-share .share-facebook  { background-color: #1877f2; }
.social-share .share-twitter   { background-color: #1da1f2; }
.social-share .share-linkedin  { background-color: #0a66c2; }
.social-share .share-pinterest { background-color: #e60023; }
.social-share .share-whatsapp  { background-color: #25d366; }

/* ================================================
   AUTHOR BOX
   ================================================ */

.author-box {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin: 2rem 0;
}

.author-box .author-avatar img {
    border-radius: 50%;
    width: 72px;
    height: 72px;
    object-fit: cover;
}

.author-box .author-name {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.author-box .author-bio {
    font-size: 0.9rem;
    color: #495057;
    margin: 0;
}

/* ================================================
   RELATED POSTS
   ================================================ */

.related-posts {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #dee2e6;
}

.related-posts-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 1rem;
}

.related-posts-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 80%;
    background: #007bff;
    border-radius: 2px;
}

/* ================================================
   PROGRESS BAR - Reading Progress
   ================================================ */

#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #00c6ff);
    z-index: 9999;
    transition: width 0.1s linear;
    width: 0;
}

/* ================================================
   RESPONSIVE EMBEDS
   ================================================ */

.embed-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
