@import url('https://fonts.googleapis.com/css2?family=Overpass:ital,wght@0,100..900;1,100..900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Petal canvas styling */
#petal-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0; /* Lowest layer for background petals */
}

body {
    font-family: 'Overpass', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121212;
    color: #FFFFFF;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Header */
header {
    background-color: #121212;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo h1 {
    color: #FFFFFF;
    font-weight: 700;
    font-size: 1.5rem;
}

nav ul {
    display: flex;
}

nav ul li {
    margin-right: 30px;
}

nav ul li a {
    color: #BBBBBB;
    font-weight: 600;
    transition: color 0.3s;
    padding: 12px 0;
    font-size: 1.1rem;
}

nav ul li a:hover,
nav ul li a.active {
    color: #E5A8B7; /* Pink color for hover */
}

.search-bar {
    display: flex;
    background: #351D23; /* Pink-tinted dark background */
    border-radius: 5px;
    overflow: hidden;
    max-width: 300px;
}

.search-bar input {
    background: #351D23; /* Pink-tinted dark background */
    border: none;
    padding: 12px 15px;
    color: #FFFFFF;
    outline: none;
    flex-grow: 1;
    font-size: 1rem;
    font-family: 'Overpass', Tahoma, Geneva, Verdana, sans-serif;
}

.search-bar button {
    background: #E5A8B7; /* Your pink color as button */
    border: none;
    color: white;
    padding: 0 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.search-bar button:hover {
    background: #D192A3; /* Slightly darker pink on hover */
}

.user-profile i {
    font-size: 28px;
    color: #FFFFFF;
    cursor: pointer;
    transition: color 0.3s;
}

.user-profile i:hover {
    color: #E5A8B7;
}

/* Main Content */
main {
    padding: 0 0 30px;
    position: relative;
    z-index: 2;
}

/* Manga Grid - Shared with both pages */
.manga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
    position: relative;
    z-index: 2;
}

.manga-card {
    background: #2C1D21; /* Dark pink-tinted background */
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
    z-index: 3;
}

.manga-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid #E5A8B7; /* Pink border on hover */
}

.manga-cover {
    position: relative;
    overflow: hidden;
    aspect-ratio: 2/3;
}

.manga-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.manga-card:hover .manga-cover img {
    transform: scale(1.05);
}

.manga-info {
    padding: 12px;
}

.manga-title {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.manga-details {
    display: flex;
    font-size: 0.8rem;
    color: #FFFFFF;
    justify-content: space-between;
}

.manga-score {
    display: flex;
    align-items: center;
}

.manga-score i {
    color: #FFCC00;
    margin-right: 4px;
}

/* Rating Overlay */
.manga-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(18, 18, 18, 0.8);
    color: #FFFFFF;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
}

.manga-rating i {
    color: #FFCC00;
    margin-right: 4px;
    font-size: 0.7rem;
}

/* Loading Spinner */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.spinner {
    border: 4px solid rgba(229, 168, 183, 0.2); /* Pink loading spinner */
    border-top: 4px solid #E5A8B7;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

#load-more-browse {
    background: #E5A8B7; /* Pink button */
    color: #121212;
    border: none;
    padding: 10px 25px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

#load-more-browse:hover {
    background: #D192A3; /* Darker pink on hover */
}

/* Footer */
footer {
    background: #2C1D21; /* Pink-tinted dark background */
    border-top: 1px solid #E5A8B7; /* Pink border */
    padding: 20px 0;
    margin-top: 30px;
    position: relative;
    z-index: 2;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer p {
    color: #FFFFFF;
    font-size: 0.9rem;
}

.social-links a {
    margin-left: 15px;
    color: #FFFFFF;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.social-links a:hover {
    color: #E5A8B7; /* Pink hover for social links */
}

/* Browse Page Specific Styles */

/* Browse Header */
.browse-header {
    margin: 40px 0 30px;
    text-align: center;
}

.browse-header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: #FFFFFF;
}

.browse-header p {
    font-size: 1.1rem;
    color: #BBBBBB;
}

/* Filter Section */
.filter-section {
    background: #1E1E1E;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid #F0C1D3; /* Light pink border */
    position: relative;
    z-index: 2;
}

.search-filter {
    margin-bottom: 25px;
}

.search-filter h3 {
    margin-bottom: 10px;
    color: #FFFFFF;
    font-size: 1.1rem;
}

.browse-search {
    display: flex;
    gap: 10px;
    max-width: 100%;
}

.browse-search input {
    flex-grow: 1;
    background: #351D23; /* Pink-tinted dark background */
    border: 1px solid #E5A8B7; /* Pink border */
    color: #FFFFFF;
    padding: 12px 15px;
    border-radius: 5px;
    font-size: 1rem;
    outline: none;
    font-family: 'Overpass', Tahoma, Geneva, Verdana, sans-serif;
}

.browse-search button {
    background: #E5A8B7; /* Pink button */
    color: #121212;
    border: none;
    border-radius: 5px;
    padding: 0 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
}

.browse-search button:hover {
    background: #D192A3; /* Darker pink on hover */
}

/* Filter Grid */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.filter-item h3 {
    margin-bottom: 10px;
    color: #FFFFFF;
    font-size: 1rem;
}

.filter-item select {
    width: 100%;
    background: #351D23; /* Pink-tinted dark background */
    color: #FFFFFF;
    border: 1px solid #E5A8B7; /* Pink border */
    padding: 10px 12px;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: 'Overpass', Tahoma, Geneva, Verdana, sans-serif;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.primary-button {
    background: #E5A8B7; /* Pink button */
    color: #121212;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.primary-button:hover {
    background: #D192A3; /* Darker pink on hover */
}

.secondary-button {
    background: transparent;
    color: #E5A8B7; /* Pink text */
    border: 1px solid #E5A8B7; /* Pink border */
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.secondary-button:hover {
    background: rgba(229, 168, 183, 0.1); /* Light pink background on hover */
}

/* Results Section */
.results-section {
    margin-bottom: 50px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-header h2 {
    font-size: 1.5rem;
    color: #FFFFFF;
}

.results-header p {
    color: #BBBBBB;
    font-size: 0.95rem;
}

#count-number {
    font-weight: 700;
    color: #E5A8B7; /* Pink number */
}

/* Media Queries */
@media (max-width: 768px) {
    header .container {
        flex-wrap: wrap;
    }

    .container .logo,
    .user-profile {
        display: none;
    }
    
    nav {
        order: 3;
        width: 100%;
        margin-top: 15px;
        padding: 0px 40px;
    }
    
    nav ul {
        justify-content: space-between;
    }
    
    nav ul li {
        margin-right: 0;
    }
    
    .search-bar {
        margin-left: auto;
        margin-right: 15px;
        margin-bottom: 15px;
    }
    
    .manga-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    /* Browse-specific media queries */
    .filter-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .filter-buttons {
        flex-direction: column;
    }

    .browse-search {
        flex-direction: column;
    }

    .browse-search button {
        padding: 5px;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}