/* Custom styles for our News website */
:root {
    --primary-color: #0066cc;
    --secondary-color: #ff9900;
    --dark-color: #333333;
    --light-color: #f8f9fa;
    --accent-color: #ff5733;
    --text-color: #212529;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    --transition-speed: 0.3s;
}

body {
    padding-top: 56px;
    padding-bottom: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: #f9f9f9;
}

.jumbotron {
    background-color: var(--light-color);
    margin-bottom: 30px;
    border-radius: 0;
}

.feature-box {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Navbar styles */
.navbar-dark {
    background: linear-gradient(135deg, var(--primary-color), #004a99) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    letter-spacing: 0.5px;
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    transition: all var(--transition-speed);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin: 0 0.2rem;
    transition: all var(--transition-speed);
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background-color: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.navbar-nav .nav-item.active .nav-link {
    color: white !important;
    background-color: rgba(255,255,255,0.15);
    font-weight: 600;
}

/* Carousel styles */
.carousel-item {
    height: 65vh;
    min-height: 300px;
    background: no-repeat center center scroll;
    background-size: cover;
    position: relative;
}

.carousel-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.6));
    z-index: 1;
}

.carousel-caption {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 25px;
    border-radius: var(--border-radius);
    bottom: 40px;
    max-width: 80%;
    margin: 0 auto;
    left: 0;
    right: 0;
    z-index: 2;
    border-left: 4px solid var(--secondary-color);
    box-shadow: var(--box-shadow);
}

.carousel-caption h2 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.carousel-caption p {
    font-size: 1.1rem;
    line-height: 1.5;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.carousel-control-prev, .carousel-control-next {
    width: 5%;
    z-index: 3;
    opacity: 0.7;
    transition: all var(--transition-speed);
}

.carousel-control-prev:hover, .carousel-control-next:hover {
    opacity: 1;
    background-color: rgba(0,0,0,0.2);
}

.carousel-indicators li {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 5px;
    background-color: rgba(255,255,255,0.5);
    transition: all var(--transition-speed);
}

.carousel-indicators .active {
    width: 14px;
    height: 14px;
    background-color: var(--secondary-color);
}

/* Section title */
.section-title {
    font-weight: bold;
    position: relative;
    padding-bottom: 12px;
    margin-bottom: 30px;
    color: var(--dark-color);
    font-size: 1.8rem;
    text-align: left;
    border-bottom: 2px solid #eee;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

/* News cards styles */
.news-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all var(--transition-speed);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: 100%;
    border: none;
    background-color: white;
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow);
}

.news-card .card-img-top {
    height: 180px;
    object-fit: cover;
    transition: all var(--transition-speed);
}

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

.news-card .card-body {
    padding: 1.25rem;
}

.news-card .card-title {
    font-weight: bold;
    margin-top: 10px;
    font-size: 1.1rem;
    min-height: 45px;
    color: var(--dark-color);
    transition: color var(--transition-speed);
}

.news-card:hover .card-title {
    color: var(--primary-color);
}

.news-card .badge {
    position: relative;
    top: -2px;
    padding: 0.4em 0.8em;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-card .card-text {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 15px;
    line-height: 1.5;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.news-meta small {
    font-size: 0.8rem;
    color: #888;
    transition: color var(--transition-speed);
}

.news-card:hover .news-meta small {
    color: #666;
}

.news-meta i {
    margin-right: 4px;
    color: var(--primary-color);
}

/* Load more button */
#loadMoreBtn {
    padding: 10px 35px;
    border-radius: 30px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0,102,204,0.2);
    transition: all var(--transition-speed);
    background-color: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

#loadMoreBtn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,102,204,0.3);
}

#loadMoreBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,102,204,0.2);
}

/* Footer styles */
footer {
    margin-top: 60px;
    padding-top: 40px;
    padding-bottom: 20px;
    border-top: 1px solid #eee;
    background-color: #f8f9fa;
}

footer h5 {
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--dark-color);
    position: relative;
    padding-bottom: 10px;
}

footer h5:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

footer ul li {
    margin-bottom: 10px;
}

footer a {
    color: #555;
    text-decoration: none;
    transition: all var(--transition-speed);
    display: block;
    padding: 3px 0;
}

footer a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

/* Media queries for responsive design */
@media (max-width: 991.98px) {
    .navbar-nav .nav-link {
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 5px;
    }
}

@media (max-width: 767.98px) {
    .carousel-item {
        height: 50vh;
    }
    
    .carousel-caption {
        padding: 15px;
        bottom: 20px;
    }
    
    .carousel-caption h2 {
        font-size: 1.6rem;
        margin-bottom: 10px;
    }
    
    .carousel-caption p {
        font-size: 0.9rem;
        display: none;
    }
    
    .news-card .card-title {
        font-size: 1rem;
        min-height: auto;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    footer {
        padding-top: 30px;
    }
    
    footer h5 {
        margin-top: 20px;
    }
}

@media (max-width: 575.98px) {
    .carousel-item {
        height: 40vh;
    }
    
    .carousel-caption {
        padding: 10px;
        max-width: 90%;
    }
    
    .carousel-caption h2 {
        font-size: 1.3rem;
    }
    
    #loadMoreBtn {
        width: 100%;
    }
    
    .news-card {
        margin-bottom: 20px;
    }
}

/* Animation classes */
.animated {
    animation-duration: 1s;
    animation-fill-mode: both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fadeIn {
    animation-name: fadeIn;
}

/* Additional animations */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: var(--box-shadow);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: var(--box-shadow);
    }
}

.pulse {
    animation: pulse 0.6s ease-in-out;
}

/* Toast styling */
.toast {
    min-width: 250px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    border-radius: var(--border-radius);
    border: none;
}

.toast-header {
    border-top-left-radius: calc(var(--border-radius) - 1px);
    border-top-right-radius: calc(var(--border-radius) - 1px);
    padding: 0.5rem 0.75rem;
}

/* Modal customization */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.modal-header {
    border-bottom-color: rgba(0,0,0,0.05);
    background-color: var(--light-color);
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.modal-footer {
    border-top-color: rgba(0,0,0,0.05);
}

/* Form control improvements */
.form-control {
    border-radius: 4px;
    border: 1px solid #ddd;
    padding: 0.6rem 0.75rem;
    transition: all var(--transition-speed);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,102,204,0.25);
}

.form-control.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-valid {
    border-color: #28a745;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* News Detail Page Styles */
.pulse {
    animation: pulse-animation 0.5s ease;
}

@keyframes pulse-animation {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

/* News Detail Content Styling */
.news-content p {
    margin-bottom: 1.2rem;
}

.news-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    border-radius: 5px;
}

.news-content h2, 
.news-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.news-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin-left: 0;
    color: #666;
    font-style: italic;
}

.news-content ul, 
.news-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.news-content li {
    margin-bottom: 0.5rem;
}

/* Back button styles */
.back-button {
    transition: all 0.3s ease;
}

.back-button:hover {
    transform: translateX(-5px);
}

/* Share button styles */
.share-buttons {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.1);
}


/* Badge Category Color Styles */
.badge-business {
    background-color: #0073b7;
    color: white;
}

.badge-education {
    background-color: #3f51b5;
    color: white;
}

.badge-entertainment {
    background-color: #9c27b0;
    color: white;
}

.badge-environment {
    background-color: #4caf50;
    color: white;
}

.badge-general {
    background-color: #607d8b;
    color: white;
}

.badge-health {
    background-color: #2196f3;
    color: white;
}

.badge-politics {
    background-color: #e91e63;
    color: white;
}

.badge-science {
    background-color: #00bcd4;
    color: white;
}

.badge-sports {
    background-color: #ff5722;
    color: white;
}

.badge-technology {
    background-color: #673ab7;
    color: white;
}

.badge-travel {
    background-color: #ff9800;
    color: white;
}

.badge-world {
    background-color: #795548;
    color: white;
}