/* Import Outfit font */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

/**
 * Factum - Custom CSS
 */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #EDF0FF;
    padding-bottom: 80px; /* Allow space for fixed footer */
    color: #000000;
}

/* Article card enhancements */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 0.5rem;
    border: none;
    color: #000000;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Article content styling */
.article-content {
    line-height: 1.8;
    font-size: 1.1rem;
    color: #000000;
}

.article-content p {
    margin-bottom: 1.5rem;
}

/* Badge styling */
.badge {
    padding: 0.4em 0.6em;
    font-weight: 500;
}

/* Navbar tweaks */
.navbar-brand h1 {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    letter-spacing: -0.5px;
    color: #000000;
}

/* Custom footer */
.fixed-bottom {
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Improved button styles */
.btn {
    border-radius: 0.4rem;
    padding: 0.5rem 1rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
}

.btn-outline-primary:hover {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

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

/* Heart Button Base Styles - Remove all Bootstrap button styling */
.heart-button.save-article-btn,
.save-article-btn.heart-button,
.save-article-btn,
.btn.save-article-btn,
.btn-sm.save-article-btn,
.btn-outline-primary.save-article-btn,
.btn-primary.save-article-btn {
    /* Reset all button styles */
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    margin-right: 15px !important; /* Maintain spacing */
    box-shadow: none !important;
    outline: none !important;
    border-radius: 0 !important;
    text-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    
    /* Heart button specific styles */
    cursor: pointer;
    display: inline-block;
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    vertical-align: middle;
    transition: transform 0.2s ease;
}

/* Hover scale effect */
.heart-button.save-article-btn:hover,
.save-article-btn:hover {
    transform: scale(1.1);
}

.heart-button.save-article-btn:active,
.save-article-btn:active {
    transform: scale(0.95);
}

/* Heart Icons Base Styles */
.heart-button.save-article-btn i,
.save-article-btn i {
    font-size: 1.25rem;
    position: absolute;
    top: 0;
    left: 0;
    transition: all 0.3s ease;
}

/* Light Theme Heart Colors */
[data-bs-theme="light"] .heart-button.save-article-btn i,
[data-bs-theme="light"] .save-article-btn i,
.heart-button.save-article-btn i,
.save-article-btn i {
    color: #666; /* Gray outline by default */
}

/* Dark Theme Heart Colors */
[data-bs-theme="dark"] .heart-button.save-article-btn i,
[data-bs-theme="dark"] .save-article-btn i {
    color: #ccc; /* Light gray outline by default */
}

/* Hide solid heart by default */
.heart-button.save-article-btn .fa-solid,
.save-article-btn .fa-solid,
.save-article-btn .fas {
    opacity: 0;
    transform: scale(0);
}

/* Show solid heart on hover for unsaved articles */
.heart-button.save-article-btn[data-saved="false"]:hover .fa-regular,
.save-article-btn[data-saved="false"]:hover .fa-regular,
.save-article-btn[data-saved="false"]:hover .far {
    opacity: 0;
}

.heart-button.save-article-btn[data-saved="false"]:hover .fa-solid,
.save-article-btn[data-saved="false"]:hover .fa-solid,
.save-article-btn[data-saved="false"]:hover .fas {
    opacity: 1;
    transform: scale(1);
    color: #000; /* Black filled heart on hover (light mode) */
}

[data-bs-theme="dark"] .heart-button.save-article-btn[data-saved="false"]:hover .fa-solid,
[data-bs-theme="dark"] .save-article-btn[data-saved="false"]:hover .fa-solid,
[data-bs-theme="dark"] .save-article-btn[data-saved="false"]:hover .fas {
    color: #fff; /* White filled heart on hover (dark mode) */
}

/* Saved state - always show filled heart */
.heart-button.save-article-btn[data-saved="true"] .fa-regular,
.save-article-btn[data-saved="true"] .fa-regular,
.save-article-btn[data-saved="true"] .far {
    opacity: 0;
}

.heart-button.save-article-btn[data-saved="true"] .fa-solid,
.save-article-btn[data-saved="true"] .fa-solid,
.save-article-btn[data-saved="true"] .fas {
    opacity: 1;
    transform: scale(1);
    color: #000; /* Black filled heart when saved (light mode) */
}

[data-bs-theme="dark"] .heart-button.save-article-btn[data-saved="true"] .fa-solid,
[data-bs-theme="dark"] .save-article-btn[data-saved="true"] .fa-solid,
[data-bs-theme="dark"] .save-article-btn[data-saved="true"] .fas {
    color: #fff; /* White filled heart when saved (dark mode) */
}

/* Pulse animation for favoriting */
.heart-button.save-article-btn.favorited,
.save-article-btn.favorited {
    animation: heartPulse 0.6s ease-out;
}

@keyframes heartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Override any remaining Bootstrap styles */
.heart-button.save-article-btn:hover,
.heart-button.save-article-btn:focus,
.heart-button.save-article-btn:active,
.heart-button.save-article-btn.active,
.save-article-btn:hover,
.save-article-btn:focus,
.save-article-btn:active,
.save-article-btn.active,
.btn.save-article-btn:hover,
.btn.save-article-btn:focus,
.btn.save-article-btn:active,
.btn-sm.save-article-btn:hover,
.btn-outline-primary.save-article-btn:hover,
.btn-primary.save-article-btn:hover {
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    border-radius: 0 !important;
    text-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* Plus button (read more) */
.read-more-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    border: none;
}

/* Remove border from theme toggle */
#theme-toggle {
    border: none;
}

/* Remove hover effects from theme toggle button */
#theme-toggle:hover {
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

#theme-toggle:focus {
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

#theme-toggle:active {
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Sources badge styling */
.sources-badge {
    background-color: transparent !important;
    color: #000000 !important;
    font-weight: 500;
    padding: 0;
    border: none;
}

/* Ensure sources badge is black in light mode */
[data-bs-theme="light"] .sources-badge {
    color: #000000 !important;
}

/* Load more button styling */
.load-more-btn {
    width: 100%;
    max-width: 100%;
    border-color: #6c757d;
    color: #6c757d;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    transition: all 0.2s ease;
}

.load-more-btn:hover {
    background-color: #f8f9fa;
    color: #495057;
}

[data-bs-theme="dark"] .load-more-btn {
    border-color: #6c757d;
    color: #adb5bd;
}

[data-bs-theme="dark"] .load-more-btn:hover {
    background-color: #343a40;
    color: #f8f9fa;
}

/* Date format styling */
.date-time {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Mobile optimization */
@media (max-width: 576px) {
    h1 {
        font-size: 1.75rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #212529;
        color: #f8f9fa;
    }
    
    .card, .modal-content {
        background-color: #343a40;
        color: #f8f9fa;
    }
    
    .navbar, .fixed-bottom {
        background-color: #343a40 !important;
    }
    
    .text-dark {
        color: #f8f9fa !important;
    }
    
    .navbar-light .navbar-brand, 
    .navbar-light .navbar-nav .nav-link {
        color: #f8f9fa;
    }
    
    .btn-outline-secondary {
        color: #e9ecef;
        border-color: #e9ecef;
    }
    
    .bg-light {
        background-color: #495057 !important;
    }
    
    .text-muted {
        color: #adb5bd !important;
    }
    
    .form-control {
        background-color: #495057;
        border-color: #6c757d;
        color: #f8f9fa;
    }
    
    .form-control:focus {
        background-color: #495057;
        color: #f8f9fa;
    }
    
    /* Dark mode sources badge */
    .sources-badge {
        color: #ffffff !important;
    }
}

/* Light mode custom styles */
[data-bs-theme="light"] {
    --bs-body-bg: #EDF0FF;
    --bs-body-color: #000000;
}

[data-bs-theme="light"] body {
    background-color: #EDF0FF;
    color: #000000;
}

[data-bs-theme="light"] .navbar {
    background-color: #FFFFFF !important;
}

[data-bs-theme="light"] .navbar-brand,
[data-bs-theme="light"] .navbar-brand h1,
[data-bs-theme="light"] .nav-link {
    color: #000000 !important;
}

[data-bs-theme="light"] .card {
    background-color: #FFFFFF !important;
    color: #000000;
}

[data-bs-theme="light"] .card-title,
[data-bs-theme="light"] .card-text {
    color: #000000;
}

[data-bs-theme="light"] .fixed-bottom {
    background-color: #FFFFFF !important;
}

[data-bs-theme="light"] .text-muted {
    color: #6c757d !important;
}

[data-bs-theme="light"] .form-control {
    color: #000000;
    background-color: #ffffff;
}

[data-bs-theme="light"] .form-control::placeholder {
    color: #6c757d;
}

/* Light mode button styles */
[data-bs-theme="light"] .btn-outline-secondary {
    color: #000000;
    border-color: #000000;
}

[data-bs-theme="light"] .btn-outline-secondary:hover {
    color: #ffffff;
    background-color: #000000;
    border-color: #000000;
}

[data-bs-theme="light"] .btn-outline-primary {
    color: #000000;
    border-color: #000000;
}

[data-bs-theme="light"] .btn-outline-primary:hover {
    color: #ffffff;
    border-color: #000000;
}

[data-bs-theme="light"] .btn-primary {
    color: #ffffff;
    background-color: #000000;
    border-color: #000000;
}

[data-bs-theme="light"] .btn-primary:hover {
    background-color: #333333;
    border-color: #333333;
}
[data-bs-theme="light"] .btn:hover {
    background-color: #000000!Important;
    border-color: #333333;
}

/* Light mode link styles */
[data-bs-theme="light"] .card-title a,
[data-bs-theme="light"] .card-title a:hover,
[data-bs-theme="light"] .text-dark {
    color: #000000 !important;
}

[data-bs-theme="light"] a.text-decoration-none {
    color: #000000 !important;
}

[data-bs-theme="light"] a.text-decoration-none:hover {
    color: #333333 !important;
}

/* Bottom navigation buttons */
.fixed-bottom .btn-outline-secondary {
    border: none;
}
.fixed-bottom .active {
    background-color: #000000;
    color: #FFFFFF;
}
.fixed-bottom .btn:not(.active) {
    background-color: #EDF0FF;
}

/* Latest button hover in light mode */
[data-bs-theme="light"] .fixed-bottom .btn:not(.active):hover {
    background-color: #000000;
    color: #FFFFFF;
    text-shadow: 0px 0px 1px rgba(0, 0, 0, 0.7); /* Add text shadow for visibility */
}

/* Saved button hover styles */
[data-bs-theme="light"] .fixed-bottom .btn:not(.active)[aria-label="Saved"]:hover,
[data-bs-theme="light"] .fixed-bottom .nav-link:not(.active)[href*="saved"]:hover {
    background-color: #000000;
    color: #000000;
    text-shadow: 0px 0px 1px rgba(255, 255, 255, 0.9); /* Add text shadow for visibility */
}

/* Saved button in dark mode */
[data-bs-theme="dark"] .fixed-bottom .btn:not(.active) {
    color: #000000;
}

/* Dark mode custom styles */
[data-bs-theme="dark"] {
    --bs-body-bg: #212529;
    --bs-body-color: #f8f9fa;
}

[data-bs-theme="dark"] body {
    background-color: #212529;
    color: #f8f9fa;
}

[data-bs-theme="dark"] .navbar {
    background-color: #1a1d20 !important;
}

[data-bs-theme="dark"] .navbar-brand h1 {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .card {
    background-color: #1a1d20 !important;
    color: #f8f9fa;
}

[data-bs-theme="dark"] .article-content {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .fixed-bottom {
    background-color: #1a1d20 !important;
}

/* Common styles */
.navbar {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .navbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
}

[data-bs-theme="dark"] .card {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card:hover {
    transform: translateY(-2px);
}

.fixed-bottom {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .fixed-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Article content styles */
.article-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

/* Badge styles */
.badge {
    font-weight: 500;
    padding: 0.5em 0.8em;
}

/* Button hover effects */
.btn {
    transition: all 0.2s ease-in-out;
}

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

/* Modal styles */
.modal-content {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

[data-bs-theme="dark"] .modal-content {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
}

/* Dark mode button styles */
[data-bs-theme="dark"] .btn-outline-secondary {
    color: #f8f9fa;
    border-color: #f8f9fa;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    color: #212529;
    background-color: #f8f9fa;
    border-color: #f8f9fa;
}

[data-bs-theme="dark"] .btn-outline-primary {
    color: #f8f9fa;
    border-color: #f8f9fa;
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
    color: #212529;
    background-color: #f8f9fa;
    border-color: #f8f9fa;
}

[data-bs-theme="dark"] .btn-primary {
    color: #212529;
    background-color: #f8f9fa;
    border-color: #f8f9fa;
}

[data-bs-theme="dark"] .btn-primary:hover {
    background-color: #e9ecef;
    border-color: #e9ecef;
}

/* Light mode badge styles */
[data-bs-theme="light"] .badge.bg-light {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-bs-theme="light"] .badge.bg-primary {
    background-color: #000000 !important;
    color: #ffffff !important;
}

/* Article detail page buttons */
.article-detail .btn-white,
.article-detail .btn-light,
.article-view .btn-white,
.article-view .btn-light,
[data-bs-theme="light"] .article-content .btn-white,
[data-bs-theme="light"] .article-content .btn-light,
.article-content .btn-outline-secondary[style*="background-color: white"],
.article-content .btn-outline-secondary[style*="background-color: #fff"],
.article-content .btn-outline-secondary[style*="background-color: #ffffff"] {
    color: #000000 !important;
}

/* Ensure all buttons with white background on article pages have black text */
.btn[style*="background-color: white"],
.btn[style*="background-color: #fff"],
.btn[style*="background-color: #ffffff"],
.btn.bg-white {
    color: #000000 !important;
}

/* Special override for article pages */
.article-detail .bg-white,
.article-view .bg-white {
    color: #000000;
}

/* Dark mode sources badge */
[data-bs-theme="dark"] .sources-badge {
    color: #ffffff !important;
}

/* Icon hover effect */
.save-article-btn i,
.btn.save-article-btn i {
    transition: transform 0.2s ease !important;
}

.save-article-btn:hover i,
.btn.save-article-btn:hover i {
    transform: scale(1.2) !important;
}

/* Button active/focus states - eliminate square completely */
.save-article-btn:focus,
.save-article-btn:active,
.save-article-btn[data-saved="true"],
.btn.save-article-btn:focus,
.btn.save-article-btn:active,
.btn-primary.save-article-btn,
.btn-primary.save-article-btn:hover,
.btn-primary.save-article-btn:focus,
.btn-primary.save-article-btn:active {
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    border-radius: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* FontAwesome heart icons - improved hover behaviors */
/* Unsaved state - regular heart */
.save-article-btn .far.fa-heart,
.save-article-btn .fas.fa-heart {
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

/* Light mode colors */
[data-bs-theme="light"] .save-article-btn .far.fa-heart,
[data-bs-theme="light"] .save-article-btn .fas.fa-heart {
    color: #000000; /* Black hearts for light mode */
}

/* Dark mode colors */
[data-bs-theme="dark"] .save-article-btn .far.fa-heart,
[data-bs-theme="dark"] .save-article-btn .fas.fa-heart {
    color: #FFFFFF; /* White hearts for dark mode */
}

/* Show filled heart on hover for unsaved articles */
.save-article-btn[data-saved="false"] .fas.fa-heart {
    display: none; /* Hide filled heart initially */
}

.save-article-btn[data-saved="false"]:hover .far.fa-heart {
    display: none; /* Hide outline heart on hover */
}

.save-article-btn[data-saved="false"]:hover .fas.fa-heart {
    display: inline-block; /* Show filled heart on hover */
}

/* Specific margin for saved states and hover states */
.btn-primary.save-article-btn,
.save-article-btn[data-saved="true"],
.save-article-btn.btn-outline-primary,
.btn-primary.save-article-btn:hover,
.save-article-btn[data-saved="true"]:hover,
.save-article-btn.btn-outline-primary:hover,
.save-article-btn:hover {
    margin-right: 15px !important;
}

/* Article link styling for theme consistency */
.card-title a {
    color: inherit;
    transition: color 0.2s ease;
}

.card-title a:hover {
    color: #0d6efd;
}

[data-bs-theme="light"] .card-title a {
    color: #000000;
}

[data-bs-theme="light"] .card-title a:hover {
    color: #3d3d3d;
}

[data-bs-theme="dark"] .card-title a {
    color: #ffffff;
}

[data-bs-theme="dark"] .card-title a:hover {
    color: #d3d3d3;
}

/* Country badge styling for theme consistency */
.badge.bg-light {
    color: #000000;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .badge.bg-light {
    background-color: #495057 !important;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* End of CSS file */ 