/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand h1 {
    font-size: 1.8rem;
    font-weight: bold;
}

.nav-brand i {
    margin-right: 10px;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-link:hover {
    opacity: 0.8;
}

.nav-auth {
    display: flex;
    gap: 1rem;
}

.btn-login, .btn-signup {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.2s;
}

.btn-login {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-signup {
    background: white;
    color: #667eea;
}

.btn-login:hover, .btn-signup:hover {
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
}

/* Search Section */
.search-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.search-container h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-weight: 300;
}

.search-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-bar input {
    flex: 1;
    padding: 1rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 25px 0 0 25px;
    outline: none;
}

.search-bar button {
    padding: 1rem 1.5rem;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    transition: background 0.3s;
}

.search-bar button:hover {
    background: #ff5252;
}

.filter-options {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-options select {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 20px;
    background: white;
    color: #333;
    cursor: pointer;
    outline: none;
}

/* Featured Section */
.featured-section {
    padding: 4rem 0;
    background: white;
}

.featured-section h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
    color: #333;
}

.featured-carousel {
    display: flex;
    justify-content: center;
}

.featured-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: transform 0.3s;
}

.featured-item:hover {
    transform: translateY(-10px);
}

.featured-item img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.featured-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 2rem;
}

.featured-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.rating i {
    color: #ffd700;
}

/* Anime List Section */
.anime-list-section {
    padding: 4rem 0;
    background: #f5f7fa;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    color: #333;
}

.view-options {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.5rem;
    background: white;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.view-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.anime-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

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

.anime-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.anime-info {
    padding: 1.5rem;
}

.anime-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.anime-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.anime-genre {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.2rem 0.5rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.anime-rating {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.anime-rating i {
    color: #ffd700;
}

.anime-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-add, .btn-favorite {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-add {
    background: #4caf50;
    color: white;
}

.btn-favorite {
    background: #ff6b6b;
    color: white;
}

.btn-add:hover {
    background: #45a049;
}

.btn-favorite:hover {
    background: #ff5252;
}

/* List View */
.anime-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.anime-grid.list-view .anime-card {
    display: flex;
    height: 150px;
}

.anime-grid.list-view .anime-card img {
    width: 100px;
    height: 100%;
}

.anime-grid.list-view .anime-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Load More Button */
.load-more {
    text-align: center;
}

.btn-load-more {
    padding: 1rem 2rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.3s;
}

.btn-load-more:hover {
    background: #5a67d8;
}

/* Add these new styles to your existing CSS */

/* Loading indicator */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.loader {
    text-align: center;
}

.loader i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.loader p {
    font-size: 1.2rem;
}

/* Enhanced anime cards */
.anime-image-container {
    position: relative;
    overflow: hidden;
}

.anime-type-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.anime-rating-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffd700;
    color: #333;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.anime-title {
    height: 2.4em;
    overflow: hidden;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.anime-original-title {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    margin: 0.5rem 0;
}

.anime-tags {
    margin: 0.5rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.anime-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.btn-info {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-info:hover {
    background: #138496;
}

/* Results count */
.results-count {
    color: #666;
    font-size: 0.9rem;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 1.5rem;
}

.anime-detail-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
}

.anime-detail-image img {
    width: 100%;
    border-radius: 8px;
}

.anime-detail-info p {
    margin-bottom: 0.8rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    background: #f0f0f0;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.anime-sources {
    margin-top: 1rem;
}

.source-link {
    display: inline-block;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
}

.source-link:hover {
    background: #5a67d8;
}

@media (max-width: 768px) {
    .anime-detail-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .anime-detail-image {
        text-align: center;
    }
    
    .anime-detail-image img {
        max-width: 200px;
    }
}

/* Loading indicator */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.loader {
    text-align: center;
}

.loader i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.loader p {
    font-size: 1.2rem;
}

/* Enhanced anime cards */
.anime-image-container {
    position: relative;
    overflow: hidden;
}

.anime-type-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.anime-rating-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffd700;
    color: #333;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.anime-title {
    height: 2.4em;
    overflow: hidden;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.anime-original-title {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    margin: 0.5rem 0;
}

.anime-tags {
    margin: 0.5rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.anime-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.btn-info {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-info:hover {
    background: #138496;
}

/* Results count */
.results-count {
    color: #666;
    font-size: 0.9rem;
    margin-left: 1rem;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.anime-detail-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
}

.anime-detail-image img {
    width: 100%;
    border-radius: 8px;
}

.anime-detail-info p {
    margin-bottom: 0.8rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    background: #f0f0f0;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.anime-sources {
    margin-top: 1rem;
}

.source-link {
    display: inline-block;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
}

.source-link:hover {
    background: #5a67d8;
    text-decoration: none;
}

@media (max-width: 768px) {
    .anime-detail-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .anime-detail-image {
        text-align: center;
    }
    
    .anime-detail-image img {
        max-width: 200px;
    }
}

/* Clickable card styles */
.clickable-card {
    cursor: pointer;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
}

.clickable-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.clickable-card:active {
    transform: translateY(-5px);
}

/* Add a subtle overlay effect on hover */
.clickable-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 10px;
    pointer-events: none;
}

.clickable-card:hover::before {
    opacity: 1;
}

/* Make sure action buttons stay interactive */
.anime-actions {
    position: relative;
    z-index: 2;
}

.anime-actions button {
    position: relative;
    z-index: 3;
}

/* Add a subtle hint that the card is clickable */
.clickable-card .anime-info {
    position: relative;
}

.clickable-card:hover .anime-title {
    color: #667eea;
    transition: color 0.3s;
}

.clickable-card:hover::after {
    opacity: 1;
}

/* Ensure buttons have proper hover states */
.anime-actions button:hover {
    transform: scale(1.05);
    z-index: 4;
}

/* List view adjustments */
.anime-grid.list-view .clickable-card {
    display: flex;
}

.anime-grid.list-view .clickable-card::after {
    bottom: 50%;
    transform: translateY(50%);
}


/* Footer */
.footer {
    background: #333;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3, .footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #555;
    color: #ccc;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        order: 3;
        gap: 1rem;
    }

    .search-container h2 {
        font-size: 2rem;
    }

    .filter-options {
        flex-direction: column;
        align-items: center;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

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

@media (max-width: 480px) {
    .anime-grid {
        grid-template-columns: 1fr;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .search-bar input,
    .search-bar button {
        border-radius: 25px;
    }
    
    .search-bar button {
        margin-top: 1rem;
    }
}
