/* ===========================================
   GLOBAL STYLES & UTILITIES
   =========================================== */

html {
    scroll-behavior: smooth;
}

.main-content {
    min-height: calc(100vh - 200px);
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.opacity-50 {
    opacity: 0.5 !important;
}

/* ===========================================
   SOCIAL SHARE COMPONENTS
   =========================================== */

.social-share {
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.social-share-btn {
    transition: all 0.3s ease;
    font-weight: 500;
    border-width: 1.5px;
    min-width: 45px;
}

.social-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Social platform specific hover colors */
.social-share-btn[data-platform="facebook"]:hover {
    background-color: #1877f2 !important;
    border-color: #1877f2 !important;
    color: white !important;
}

.social-share-btn[data-platform="twitter"]:hover {
    background-color: #000000 !important;
    border-color: #000000 !important;
    color: white !important;
}

.social-share-btn[data-platform="linkedin"]:hover {
    background-color: #0a66c2 !important;
    border-color: #0a66c2 !important;
    color: white !important;
}

.social-share-btn[data-platform="whatsapp"]:hover {
    background-color: #25d366 !important;
    border-color: #25d366 !important;
    color: white !important;
}

.social-share-btn[data-platform="telegram"]:hover {
    background-color: #0088cc !important;
    border-color: #0088cc !important;
    color: white !important;
}

.social-share-btn[data-platform="email"]:hover {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
}

.social-share-btn[data-platform="copy"]:hover {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #212529 !important;
}

/* ===========================================
   HERO & SECTION LAYOUTS
   =========================================== */

.hero-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0 0 2rem 2rem;
    margin-bottom: 2rem;
}

.newsletter-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.contact-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

/* ===========================================
   CARD COMPONENTS
   =========================================== */

.card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

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

/* Card image containers with responsive aspect ratios */
.card-img-container {
    height: 180px;
    overflow: hidden;
}

.card-img-top {
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
    background: linear-gradient(90deg, #f0f0f0 25%, transparent 37%, #f0f0f0 63%);
    background-size: 400% 100%;
    animation: loading 1.4s ease infinite;
}

.card-img-top[src],
.card-img-top.loaded {
    background: none;
    animation: none;
    opacity: 1;
}

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

/* Card text improvements */
.card-title a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===========================================
   BUTTON STYLES
   =========================================== */

.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary:hover {
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

.btn-outline-primary {
    border: 2px solid;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

/* ===========================================
   AUTHOR & SOCIAL LINKS
   =========================================== */

.author-image img {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.author-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2) !important;
}

.social-links .btn {
    transition: all 0.3s ease;
}

.social-links .btn:hover {
    transform: translateY(-2px);
}

/* ===========================================
   FORM ELEMENTS
   =========================================== */

.hero-section .form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* ===========================================
   TOAST & FEEDBACK
   =========================================== */

.toast-container .toast {
    min-width: 300px;
}

/* ===========================================
   ACCESSIBILITY
   =========================================== */

.btn:focus,
.form-control:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* ===========================================
   DARK MODE SUPPORT
   =========================================== */

body.dark-mode .social-share {
    border-top-color: #21262d;
    border-bottom-color: #21262d;
    background-color: #161b22;
}

body.dark-mode .social-share h5 {
    color: #f0f6fc !important;
}

body.dark-mode .social-share .text-muted {
    color: #8b949e !important;
}

/* ===========================================
   UTILITY CLASSES
   =========================================== */

hr.border-2 {
    border-width: 2px !important;
    max-width: 100px;
    margin: 0 auto;
}

.object-fit-cover {
    object-fit: cover;
}

.position-absolute .badge {
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===========================================
   RESPONSIVE BREAKPOINTS
   =========================================== */

/* Mobile First (up to 575.98px) */
@media (max-width: 575.98px) {
    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .hero-section {
        padding: 2rem 0 !important;
        margin-bottom: 1rem;
        border-radius: 0;
    }
    
    .latest-posts-section,
    .liked-posts-section {
        padding: 2rem 0 !important;
    }
    
    .newsletter-section,
    .about-section,
    .contact-section {
        padding: 3rem 0 !important;
    }
    
    .card-img-container {
        height: 160px;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    .card-title {
        font-size: 1rem !important;
        line-height: 1.3;
    }
    
    .card-text {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .badge {
        font-size: 0.7rem;
        padding: 0.25em 0.5em;
    }
    
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .social-share-btn {
        min-width: 40px;
        font-size: 0.875rem;
    }
    
    .social-share .d-flex {
        gap: 1rem !important;
    }
    
    .row.g-3 {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
    }
    
    .pagination {
        justify-content: center !important;
    }
    
    .pagination .page-link {
        padding: 0.5rem 0.75rem;
        margin: 0 0.125rem;
    }
}

/* Small tablets (576px to 767.98px) */
@media (min-width: 576px) {
    .card-img-container {
        height: 200px;
    }
    
    .social-share .d-flex.flex-wrap {
        justify-content: center;
    }
    
    .social-share-btn {
        flex: 1;
        max-width: 100px;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .col-sm-6 {
        flex: 0 0 auto;
        width: 50%;
    }
}

/* Medium screens (768px to 991.98px) */
@media (max-width: 767.98px) {
    .container-lg {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .social-links .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
    
    .newsletter-section .col-sm-8,
    .newsletter-section .col-sm-4 {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .newsletter-section .btn {
        margin-top: 0.5rem;
    }
    
    .p-3.p-md-5 {
        padding: 1.5rem !important;
    }
    
    .social-share {
        padding: 1rem !important;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-section {
        padding: 3rem 0 !important;
    }
    
    .latest-posts-section,
    .liked-posts-section {
        padding: 3rem 0 !important;
    }
    
    .col-md-6 {
        margin-bottom: 1.5rem;
    }
    
    .row.g-3.g-md-4 {
        --bs-gutter-x: 1.5rem;
        --bs-gutter-y: 1.5rem;
    }
}

/* Large screens (992px to 1199.98px) */
@media (min-width: 992px) {
    .hero-section {
        padding: 4rem 0 !important;
    }
    
    .latest-posts-section,
    .liked-posts-section {
        padding: 4rem 0 !important;
    }
    
    .card-img-container {
        height: 160px;
    }
    
    .col-lg-4 {
        flex: 0 0 auto;
        width: 33.333333%;
    }
}

/* Extra large screens (1200px+) */
@media (min-width: 1200px) {
    .card-img-container {
        height: 180px;
    }
    
    .col-xl-3 {
        flex: 0 0 auto;
        width: 25%;
    }
}

/* ===========================================
   PRINT STYLES
   =========================================== */

@media print {
    .hero-section,
    .newsletter-section,
    .contact-section {
        background: none !important;
    }
    
    .btn,
    .social-links {
        display: none !important;
    }
}