/* Her evren için özel arka planlar */
body[class="marvel-page"] {
    background: url('../assets/images/bg-marvel.jpg') no-repeat center center fixed;
    background-size: cover;
    background-attachment: fixed;
    background-color: rgba(255, 0, 0, 0.1);
}

body.dc-page {
    background: url('../assets/images/bg-dc.jpg') no-repeat center -1% fixed;
    background-size: cover;
    background-attachment: fixed;
    background-color: rgba(0, 0, 255, 0.1);
}

body[class="image-page"] {
    background: url('../assets/images/bg-image.jpg') no-repeat center center fixed;
    background-size: cover;
    background-attachment: fixed;
    background-color: rgba(255, 165, 0, 0.1);
}

body[class="de-page"] {
    background: url('../assets/images/bg-de.jpg') no-repeat center center fixed;
    background-size: cover;
    background-attachment: fixed;
    background-color: rgba(128, 0, 128, 0.1);
}

/* Mevcut içeriğin okunabilir olması için overlay ekleyelim */
.characters-content {
    position: relative;
    z-index: 1;
    margin-top: 100px;
    padding: 2rem;
}

.characters-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.search-section {
    background: rgba(128, 0, 32, 0.2);
    border: 2px solid rgba(128, 0, 32, 0.6);
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    position: relative;
}

.search-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(128, 0, 32, 0.3);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    z-index: 1;
}

.search-container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
}

.search-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #ffd700;
}

#characterSearch {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1.2rem;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
}



#sortCharacters {
    padding: 0.8rem 1.2rem;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #ffd700;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
    width: 100%;
}

#sortCharacters:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.02);
}

#sortCharacters option {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px;
    font-size: 1rem;
}


.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.character-card {
    perspective: 1000px;
    height: 400px;
    cursor: pointer;
    background: transparent;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.character-card:hover .card-inner {
    transform: none;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid rgba(128, 0, 32, 0.6);
    background: rgba(128, 0, 32, 0.2);
}

.card-front::before, .card-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(128, 0, 32, 0.4);
    backdrop-filter: blur(5px);
    z-index: 1;
}

.card-front img {
    width: 90%;
    height: 90%;
    object-fit: cover;
    position: relative;
    z-index: 2;
}

.card-front h3 {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12.5px;
    margin: 0;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    z-index: 2;
    background: rgba(0, 0, 0, 0.5);
}

.card-back {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: auto;
    background: rgba(128, 0, 32, 0.8);
}

.character-card:hover .card-front img {
    opacity: 0.2;
    transition: opacity 0.3s ease;
}

.character-card:hover .card-back {
    opacity: 1;
    z-index: 3;
}

.card-back h3 {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
    font-size: 1.8em;
}

.card-back p {
    color: white;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
    font-size: 1.2em;
}

.details-btn {
    margin-top: 20px;
    padding: 15px 30px;
    border: 3px solid #ffd700;
    background: rgba(0, 0, 0, 0.7);
    color: #ffd700;
    font-weight: bold;
    font-size: 1.1em;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.9);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.details-btn:hover {
    background: rgba(255, 215, 0, 0.5);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

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

.modal-content {
    position: relative;
    background: rgba(20, 20, 20, 0.95);
    margin: 80px auto 30px;
    padding: 30px;
    width: 95%;
    max-width: 1200px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
    color: white;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 40px;
    color: #ff0000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: #ffd700;
    transform: scale(1.1);
}

.character-header {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.character-header img {
    width: 300px;
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
}

.character-title h2 {
    font-size: 2.5em;
    margin: 0;
    color: #ff0000;
}

.character-stats {
    margin: 30px 0;
}

.stat {
    margin: 15px 0;
}

.stat-label {
    display: block;
    margin-bottom: 5px;
}

.stat-bar {
    background: rgba(255, 255, 255, 0.1);
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background: #ff0000;
    transition: width 0.5s ease;
}

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

.gallery-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-grid img:hover {
    transform: scale(1.05);
}

/* Modal Stilleri */
.modal-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.modal-header img {
    width: 300px;
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
}

.power-stats {
    margin-top: 20px;
}

.stat {
    margin: 10px 0;
}

.stat-bar {
    width: 200px;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background: #ffd700;
    transition: width 0.5s ease;
}

/* Modal içeriği için yeni stiller */
.modal-content {
    color: white;
    padding: 30px;
}

.character-info .real-name {
    font-size: 1.2em;
    color: #ffd700;
    margin: 10px 0;
}

.character-info .actor {
    font-style: italic;
    margin: 5px 0;
}

.power-stats {
    margin: 20px 0;
}

.stat {
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat label {
    width: 120px;
    text-transform: uppercase;
    font-size: 0.9em;
}

.stat-bar {
    flex: 1;
    height: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ff4500);
    transition: width 0.5s ease;
}

.stat-value {
    width: 50px;
    text-align: right;
}

.modal-body {
    margin-top: 30px;
}

.modal-body h3 {
    color: #ffd700;
    margin: 25px 0 15px;
}

.character-abilities ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.character-abilities li {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.marvel-role {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 10px;
}

.sort-box {
    min-width: 220px;
    margin-left: auto;
}

.sort-box select {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 5px;
    font-family: 'Orbitron', sans-serif;
}

.sort-box select:hover {
    background: rgba(255, 215, 0, 0.3);
}

/* Logo rengi düzeltmesi */
.logo-text a {
    color: white;
    text-decoration: none;
}

.logo-text a:hover {
    color: #ffd700;
}

/* Yıldız stil sistemi */
.star-rating {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.star {
    color: gold;
    font-size: 1.3rem;
}

.star.filled {
    color: #ffd700;
    text-shadow: 0 0 8px #ffd700, 0 0 15px #ff0000;
}

.stat {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.stat label {
    min-width: 120px;
    text-transform: uppercase;
    font-weight: bold;
}

.stat-value {
    display: none;
}

/* Modal yeniden hizalama */
.modal-main {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.modal-image {
    flex: 0 0 300px;
    max-width: 300px;
}

.modal-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.modal-info {
    flex: 1;
    color: white;
}

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

.modal-info p {
    margin: 10px 0;
    font-size: 1.2rem;
}

.modal-info h3 {
    margin-top: 20px;
    color: #ff0000;
    font-size: 1.3em;
}

.slide-up {
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobil düzenlemeler */
@media screen and (max-width: 1200px) {
    .characters-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 sütun */
        gap: 1rem;
    }
}

@media screen and (max-width: 992px) {
    .characters-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 sütun */
        gap: 1rem;
    }
}

@media screen and (max-width: 768px) {
    .characters-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 sütun */
        gap: 0.8rem;
    }

    .character-card {
        height: 200px; /* Daha kompakt kartlar */
    }

    .search-row {
        flex-direction: column;
        gap: 0.8rem;
    }

    .search-box {
        width: 100%;
    }


    

    .sort-box {
        width: 100%;
    }

    .card-front h3 {
        font-size: 0.9rem;
        padding: 8px;
    }

    .card-back h3 {
        font-size: 1rem;
    }

    .card-back p {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }

    .details-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media screen and (max-width: 480px) {
    .characters-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 sütun korunuyor */
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .character-card {
        height: 180px; /* Daha da kompakt kartlar */
    }
}

.filter-sort-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

@media screen and (max-width: 768px) {
    .filter-sort-container {
        flex-direction: column;
        width: 100%;
    }
}

.navbar {
    z-index: 1000;
}

body:has(.character-modal[style*="display: block"]) .navbar {
    display: none;
}
