/* Characters Page Specific Styles */

.characters-header {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
}

.back-btn {
    position: absolute;
    left: 20px;
    top: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
    font-size: 0.95em;
}

.back-btn:hover {
    transform: translateX(-5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.back-btn span {
    font-size: 1.2em;
}

/* Search Section */
.search-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto 15px;
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #f093fb;
    border-radius: 30px;
    font-size: 1.1em;
    transition: all 0.3s;
    outline: none;
    background: white;
}

.search-input:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(240, 147, 251, 0.1);
}

.search-input::placeholder {
    color: #999;
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3em;
    color: #f093fb;
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.stats {
    color: #764ba2;
    font-weight: bold;
}

.view-buttons {
    display: flex;
    gap: 5px;
    background: #f0f0f0;
    padding: 3px;
    border-radius: 20px;
}

.view-btn {
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 15px;
    cursor: pointer;
    color: #999;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn:hover {
    color: #764ba2;
}

.view-btn.active {
    background: white;
    color: #764ba2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Characters Container - Base */
.characters-grid {
    margin-bottom: 40px;
}

/* List View (Default) */
.characters-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* Grid View */
.characters-grid.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}


/* Character Card - List View */
.list-view .character-card {
    background: white;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 20px;
}

.list-view .character-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(118, 75, 162, 0.15);
    background: linear-gradient(90deg, white 0%, #f093fb08 100%);
}

/* Character Card - Grid View */
.grid-view .character-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.grid-view .character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(118, 75, 162, 0.15);
}


/* Image Container - Different Views */
.list-view .character-image-container,
.grid-view .character-image-container {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #f093fb20, #f5576c20);
}


.character-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Character Initial Fallback */
.character-initial {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: #764ba2;
    display: none;
}

.character-image-container.no-image .character-initial {
    display: block;
}


.oc-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.65em;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Character Info - List View */
.list-view .character-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Character Info - Grid View */
.grid-view .character-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}


/* Character Name - Different Views */
.list-view .character-name {
    color: #764ba2;
    font-size: 1.15em;
    margin: 0;
    font-weight: 600;
    flex: 1;
}

.grid-view .character-name {
    color: #764ba2;
    font-size: 1.05em;
    margin: 0;
    font-weight: 600;
}


/* Download Button - Different Views */
.list-view .download-character-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
    white-space: nowrap;
}

.grid-view .download-character-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 18px;
    font-size: 0.85em;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}


.download-character-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    margin: 40px auto;
    max-width: 400px;
}

.no-results h3 {
    color: #764ba2;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.no-results p {
    color: #666;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .back-btn {
        position: static;
        margin-bottom: 20px;
    }
    
    .search-input {
        font-size: 1em;
        padding: 12px 45px 12px 15px;
    }
    
    .controls-row {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .stats {
        text-align: center;
    }
    
    .view-buttons {
        justify-content: center;
    }
    
    .grid-view {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .list-view .character-image-container,
    .grid-view .character-image-container {
        width: 50px;
        height: 50px;
    }
    
}

@media (max-width: 480px) {
    .list-view .character-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .list-view .download-character-btn {
        align-self: stretch;
        text-align: center;
    }
    
    .grid-view {
        grid-template-columns: repeat(2, 1fr);
    }
}