* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

/* Header */
.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 30px 20px;
}

.header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header h1 i {
    margin-right: 15px;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Search Container */
.search-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 40px;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 1.2em;
}

.search-box input {
    width: 100%;
    padding: 15px 20px 15px 55px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-container select {
    flex: 1;
    min-width: 200px;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    background: white;
}

.filter-container select:focus {
    outline: none;
    border-color: #667eea;
}

/* Characters Grid */
.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

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

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

.character-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.character-info {
    padding: 20px;
}

.character-name {
    font-size: 1.4em;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.character-category {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    margin-bottom: 10px;
}

.category-anime { background: #ffeaa7; color: #d63031; }
.category-manga { background: #81ecec; color: #00b894; }
.category-game { background: #a29bfe; color: #6c5ce7; }
.category-movie { background: #fd79a8; color: #e84393; }

.character-description {
    color: #666;
    font-size: 0.95em;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Loading & No Results */
.loading, .no-results {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.loading i {
    font-size: 3em;
    margin-bottom: 15px;
}

.no-results i {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.7;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 50px auto;
    border-radius: 20px;
    max-width: 900px;
    width: 90%;
    position: relative;
    animation: modalSlide 0.3s;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2em;
    color: #333;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.close-btn:hover {
    background: #f0f0f0;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 0;
}

.modal-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.modal-image img {
    max-width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-info {
    padding: 40px;
}

.modal-info h2 {
    font-size: 2em;
    color: #333;
    margin-bottom: 15px;
}

.modal-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.badge {
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.popularity {
    background: #ffeaa7;
    color: #d63031;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
}

.info-section {
    margin-bottom: 25px;
}

.info-section h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.info-section h3 i {
    margin-right: 8px;
}

.info-section p {
    color: #666;
    line-height: 1.8;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
}

.info-item i {
    color: #667eea;
    font-size: 1.2em;
}

.info-item .label {
    font-weight: 600;
    color: #333;
}

.info-item .value {
    color: #666;
    margin-left: auto;
}

.social-links h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.social-links h3 i {
    margin-right: 8px;
}

.social-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.social-btn {
    padding: 10px 20px;
    border-radius: 8px;
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s;
}

.social-btn:hover {
    transform: translateY(-3px);
}

.social-btn.facebook { background: #3b5998; }
.social-btn.twitter { background: #1da1f2; }
.social-btn.instagram { background: #e4405f; }
.social-btn.youtube { background: #cd201f; }
.social-btn.website { background: #667eea; }

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2em;
    }
    
    .modal-body {
        grid-template-columns: 1fr;
    }
    
    .modal-image {
        padding: 20px;
    }
    
    .modal-info {
        padding: 25px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .characters-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 480px) {
    .characters-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-container {
        flex-direction: column;
    }
    
    .filter-container select {
        width: 100%;
    }
}
/* Additional styles for new features */
.character-kanji {
    color: #999;
    font-size: 0.9em;
    margin-bottom: 8px;
    font-style: italic;
}

.character-stats {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #e84393;
    font-weight: 600;
    font-size: 0.9em;
}

.stat i {
    font-size: 0.9em;
}

/* Anime grid in modal */
.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.anime-item {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: transform 0.3s;
}

.anime-item:hover {
    transform: translateY(-5px);
}

.anime-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

.anime-item span {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 0.85em;
    margin-bottom: 4px;
}

.anime-item small {
    color: #667eea;
    font-size: 0.75em;
}

/* Voice actors grid */
.va-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.va-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
}

.va-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.va-item div {
    flex: 1;
}

.va-item strong {
    display: block;
    color: #333;
    font-size: 0.9em;
    margin-bottom: 2px;
}

.va-item small {
    color: #666;
    font-size: 0.8em;
}

/* Loading animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s infinite;
}