/* static/css/home.css */

/* General Styles */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.main-content {
    padding: 20px 0;
}

/* Custom Carousel Styles */
.carousel-container {
    position: relative;
    overflow: hidden;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    height: 80vh; /* Increased height to better accommodate 1920x1080 images */
    margin-bottom: 40px;
}

.carousel-slides {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.45, 0, 0.55, 1);
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #ffffff;
    padding: 40px 20px 20px;
    font-size: 1.2em;
    font-weight: 500;
    text-align: center;
}

/* Navigation Buttons */
.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: #ffffff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
}

.carousel-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.carousel-button.prev {
    left: 30px;
}

.carousel-button.next {
    right: 30px;
}

/* Indicators */
.carousel-indicators {
    position: absolute;
    bottom: 25px;
    left: 0;
    right: 0;
    display: flex;
    gap: 12px;
    z-index: 10;
    justify-content: center;
    width: 100%;
    padding: 0;
    margin: 0 auto;
}

.carousel-indicators .indicator {
    width: 40px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.carousel-indicators .indicator:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.carousel-indicators .indicator.active {
    background-color: #ffffff;
    transform: scaleX(1.2);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 70px 20px;
    text-align: center;
    margin-bottom: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-title {
    color: #ffffff;
    font-size: 2.8em;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.hero-subtitle {
    color: #ffffff;
    font-size: 1.4em;
    font-weight: 500;
    margin-bottom: 35px;
    line-height: 1.6;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.2);
    opacity: 0.95;
}

.hero-cta {
    margin-top: 30px;
}

.cta-button {
    display: inline-block;
    background-color: #ffffff;
    color: #667eea;
    padding: 16px 45px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15em;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    letter-spacing: 0.3px;
}

.cta-button:hover {
    background-color: #ffd700;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color: #5a67d8;
}

/* Content Wrapper */
.content-wrapper {
    display: flex;
    gap: 20px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

/* Blog Posts Container */
.posts-container {
    flex: 3;
    width: 100%;
}

.posts-container h2 {
    margin-bottom: 30px;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    position: relative;
    font-size: 2.2em;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.posts-container h2::after {
    content: '';
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%);
    display: block;
    margin: 15px auto 0;
    border-radius: 3px;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

/* Individual Post */
.post {
    background-color: #ffffff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.post:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.post h3 {
    margin-bottom: 10px;
    color: #2563eb;
    transition: all 0.3s ease;
    font-size: 1.6em;
    font-weight: 700;
    line-height: 1.3;
}

.post h3 a {
    text-decoration: none;
    color: #2563eb;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.post h3 a:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: translateX(5px);
}

.post p {
    line-height: 1.6;
    color: #555555;
}

/* Read More Button */
.read-more {
    display: inline-block;           
    margin-top: 10px;               
    padding: 10px 15px;             
    background-color: #007bff;      
    color: #ffffff;                  
    text-decoration: none;           
    border-radius: 5px;             
    transition: background-color 0.3s;
}

.read-more:hover {
    background-color: #0056b3; /* Darker blue on hover */    
}

/* Sidebar */
.sidebar {
    flex: 1;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 80px; /* Adjust based on navbar height */
    transition: box-shadow 0.3s;
}

.sidebar h2 {
    margin-bottom: 15px;
    color: #007bff;
    text-align: center;
    position: relative;
}

.sidebar h2::after {
    content: '';
    width: 40px;
    height: 3px;
    background-color: #007bff;
    display: block;
    margin: 10px auto 0;
    border-radius: 2px;
}

.categories-list {
    list-style: none;
    padding: 0;
}

.categories-list li {
    margin-bottom: 10px;
    text-align: center;
}

.categories-list li a {
    color: #333333;
    font-size: 1em;
    transition: color 0.3s, background-color 0.3s;
    padding: 8px 12px;
    border-radius: 5px;
    display: inline-block;
    width: 100%;
    text-decoration: none;
}

.categories-list li a:hover {
    background-color: #007bff;
    color: #ffffff;
}

/* Pagination */
.pagination {
    text-align: center;
    margin-top: 20px;
}

.page-links a,
.page-links span {
    color: #007bff;
    padding: 8px 16px;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
    border-radius: 5px;
    margin: 0 2px;
    border: 1px solid #007bff;
}

.page-links a:hover {
    background-color: #007bff;
    color: #ffffff;
}

.page-links .current {
    background-color: #007bff;
    color: #ffffff;
    cursor: default;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .content-wrapper {
        flex-direction: column;
    }

    .carousel-container {
        height: 60vh;
    }

    .hero-title {
        font-size: 2.2em;
        letter-spacing: -0.3px;
    }

    .hero-subtitle {
        font-size: 1.2em;
    }

    .cta-button {
        font-size: 1.05em;
        padding: 14px 35px;
    }
}

@media (max-width: 768px) {
    .carousel-container {
        height: 50vh;
        min-height: 300px; /* Ensure minimum height on mobile */
    }

    .carousel-caption {
        font-size: 1em;
        padding: 30px 15px 15px;
    }

    .carousel-button {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }

    .carousel-button.prev {
        left: 15px;
    }

    .carousel-button.next {
        right: 15px;
    }

    .carousel-indicators {
        bottom: 15px;
    }

    .carousel-indicators .indicator {
        width: 30px;
        height: 3px;
    }

    .carousel-container {
        padding-top: 56.25%; /* Maintain 16:9 aspect ratio */
    }

    .carousel-slide img {
        height: 100%; /* Ensure image height adjusts based on container */
    }

    .carousel-caption {
        font-size: 0.9em;
        padding: 8px 12px;
        bottom: 15px;
        left: 15px;
    }

    .post {
        padding: 15px;
        margin-bottom: 15px;
    }

    .sidebar {
        margin-top: 20px;
    }

    .content-wrapper {
        gap: 15px;
    }

    .hero-section {
        padding: 50px 20px;
    }

    .hero-title {
        font-size: 1.8em;
        letter-spacing: -0.3px;
        margin-bottom: 15px;
    }

    .hero-subtitle {
        font-size: 1.1em;
        margin-bottom: 25px;
    }

    .cta-button {
        padding: 14px 35px;
        font-size: 1.05em;
    }

    .posts-container h2 {
        font-size: 1.8em;
    }

    .categories-list li a {
        font-size: 0.9em;
        padding: 6px 10px;
    }

    /* Adjust navigation buttons size on smaller screens */
    .carousel-button {
        padding: 8px;
    }

    /* Hide indicators on small screens (optional) */
    .carousel-indicators {
        display: none;
    }
}

@media (max-width: 644px) {
    .carousel-container {
        padding-top: 56.25%; /* Maintain 16:9 aspect ratio */
    }

    .carousel-slide img {
        height: 100%; /* Ensure image height adjusts based on container */
    }
}

@media (max-width: 480px) {
    .carousel-container {
        height: 40vh;
    }

    .carousel-button {
        width: 35px;
        height: 35px;
        font-size: 1em;
    }
}
