@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    list-style: none;
    font-family: 'Kanit', sans-serif;
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    height: .1rem;
    width: .5rem;
}

::-webkit-scrollbar-track {
    background-color: #121212;
}

::-webkit-scrollbar-thumb {
    background-color: #DF2626;
    border-radius: 5rem;
}

body {
    background: #121212;
    color: #FAFAFA;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

header {
    background: #121212;
    padding: 15px 10%;
    position: fixed;
    top: 0%;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center; /* Centers everything */
    align-items: center;
    gap: 600px; /* Adjust spacing */
    z-index: 1001;
    transition: 0.2s ease-in-out;
    box-shadow: 1px 7px 5px 0px rgba(0,0,0,0.49);
    -webkit-box-shadow: 1px 7px 5px 0px rgba(0,0,0,0.49);
    -moz-box-shadow: 1px 7px 5px 0px rgba(0,0,0,0.49);
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navlist {
    display: flex;
    align-items: center;
    gap: 50px;
}

.navlist li a {
    color: #FAFAFA;
    font-weight: 500;
    font-size: 16px;
}

.navlist li a:hover {
    color: #DF2626;
    transition: 0.3s ease-in-out;
}

.logo-img {
    width: 200px;
    height: auto;
    
}

/* Characters Header Section */
.characters-header {
    position: relative;
    height: 300px;
    background-color: black;
    background-image: url('../assets/characters-banner.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 70px; /* To account for fixed header */
}

.characters-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(18, 18, 18, 0.7), rgba(18, 18, 18, 0.9));
}

.characters-header-content {
    position: relative;
    text-align: center;
    max-width: 800px;
    padding: 0 20px;
    z-index: 10;
}

.characters-header-content h1 {
    font-size: 48px;
    font-weight: 800;
    color: #DF2626;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.characters-header-content p {
    font-size: 18px;
    color: #FAFAFA;
    line-height: 1.6;
}

/* Characters Content Section */
.characters-content {
    display: flex;
    background-color: #121212;
    min-height: calc(100vh - 370px); /* Subtract header height + navbar height */
}

/* Sidebar Styles */
.characters-sidebar {
    width: 280px;
    background-color: #191919;
    padding: 30px 0;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    position: sticky;
    top: 70px; /* Account for navbar height */
    height: calc(100vh - 70px);
}

.sidebar-search {
    padding: 0 20px;
    margin-bottom: 30px;
    display: flex;
}

.sidebar-search input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background-color: #262626;
    color: #FAFAFA;
    border-radius: 5px 0 0 5px;
    font-size: 14px;
}

.sidebar-search input::placeholder {
    color: #777;
}

.search-btn {
    background-color: #DF2626;
    color: #FAFAFA;
    border: none;
    padding: 0 15px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background-color: #b51d1d;
}

.sidebar-nav {
    padding: 0 15px;
}

.sidebar-category {
    margin-bottom: 15px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #232323;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.category-header:hover {
    background-color: #2a2a2a;
}

.category-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #FAFAFA;
}

.category-header i {
    color: #DF2626;
    transition: transform 0.3s ease;
}

.category-header i.rotated {
    transform: rotate(180deg);
}

.category-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    margin-left: 15px;
}

.category-list.active {
    max-height: 500px; /* Adjust based on expected content */
    margin-top: 10px;
    margin-bottom: 10px;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list li a {
    color: #a3a3a3;
    font-size: 14px;
    transition: color 0.3s ease;
    display: block;
    padding: 6px 15px;
    border-radius: 4px;
}

.category-list li a:hover {
    color: #DF2626;
    background-color: #1c1c1c;
}

/* Main Content Styles */
.characters-main {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.characters-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.filter-btn {
    padding: 8px 20px;
    background-color: #232323;
    color: #a3a3a3;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: #2a2a2a;
    color: #FAFAFA;
}

.filter-btn.active {
    background-color: #DF2626;
    color: #FAFAFA;
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
}

.character-item {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.character-item.hidden {
    display: none;
}

.character-item.fade {
    opacity: 0;
    transform: translateY(20px);
}

.character-card {
    background-color: #191919;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.character-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.character-img-container {
    height: 250px;
    overflow: hidden;
}

.character-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.character-card:hover .character-img {
    transform: scale(1.1);
}

.character-name {
    color: #FAFAFA;
    font-size: 16px;
    font-weight: 600;
    padding: 15px 15px 5px;
}

.character-affiliation {
    color: #a3a3a3;
    font-size: 14px;
    padding: 0 15px 15px;
}

.load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 50px;
}

.load-more-btn {
    background-color: transparent;
    color: #DF2626;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 30px;
    border: 2px solid #DF2626;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background-color: #DF2626;
    color: #FAFAFA;
}

/* Footer Styles */
.footer {
    background-color: #0f0f0f;
    padding: 60px 0 20px;
    color: #a3a3a3;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 40px;
}

.footer-logo {
    flex: 1;
    min-width: 200px;
    max-width: 250px;
    margin-bottom: 30px;
}

.footer-logo-img {
    width: 100%;
    height: auto;
}

.footer-links {
    flex: 2;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.footer-links-column {
    min-width: 150px;
    margin-bottom: 30px;
}

.footer-links-column h4 {
    color: #FAFAFA;
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

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

.footer-links-column ul li a {
    color: #a3a3a3;
    transition: color 0.3s ease;
}

.footer-links-column ul li a:hover {
    color: #DF2626;
}

.footer-social {
    flex: 1;
    min-width: 200px;
}

.footer-social h4 {
    color: #FAFAFA;
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #232323;
    color: #FAFAFA;
    font-size: 18px;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: #DF2626;
    transform: translateY(-5px);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 0;
    border-top: 1px solid #2a2a2a;
    text-align: center;
    font-size: 14px;
}

/* Media Queries for Responsiveness */
@media (max-width: 1024px) {
    .featured-news {
        flex-direction: column;
    }
    
    .featured-news-image {
        min-height: 250px;
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
    }
    
    .footer-logo {
        max-width: 200px;
        margin: 0 auto 30px;
    }
    
    .footer-links {
        width: 100%;
        margin-bottom: 30px;
    }
    
    .footer-social {
        text-align: center;
        width: 100%;
    }
    
    .social-icons {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}