/* Börja enkelt */
body {
    font-family:'Segoe UI', sans-serif;
    margin: 0;
    padding: 20px;
    background: #0f0f0f;
    color: #e0e0e0;
}

/* Grid för kort */
#container, #listContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

#listButtons{
    display: flex;
    justify-content: center;
}

/* Kort-styling */
.movieCard, .personcard {
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    cursor: default;
    transition: all 0.2s;
    border: 1px solid #333333;
}

.movieCard:hover, .personcard:hover {
    background: #2a2a2a;
    transform: scale(1.02);
    box-shadow: 0 0 12px rgba(171, 30, 30, 0.4), 0 2px 8px rgba(0,0,0,0.5);
}

.movieCard img, .personcard img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.movieCard h3, .personcard h3 {
    margin: 12px;
    font-size: 16px;
}

.movieCard p, .personcard p {
    margin: 0 12px 12px;
    font-size: 14px;
    color: #b0b0b0;
}

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

header {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    position: relative;
    padding: 15px 20px;
    background: #0f0f0f;
    border-bottom: 2px solid #ab1e1e;
}

header h2 {
    margin: 0;
    flex-grow: 1;
    text-align: center;
    color: #e0e0e0;
    font-size: 24px;
}

#headerTitle {
    margin: 0;
    flex-grow: 1;
    text-align: center;
    color: #e0e0e0;
    font-size: 24px;
    font-weight: bold;
}

#homeBtn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    position: absolute;
    right: 20px;
}

#homeBtn:hover {
    opacity: 0.7;
}

#searchForm {
    display: flex;
    justify-content: center;

    gap: 10px;
    align-items: center;
}

#search {
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #333333;
    padding: 10px 12px;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Segoe UI', sans-serif;
    width: 400px;
    transition: all 0.2s;
}

#search::placeholder {
    color: #888888;
}

#search:focus {
    outline: none;
    border-color: #ab1e1e;
    box-shadow: 0 0 8px rgba(171, 30, 30, 0.3);
}

#searchForm button {
    background: #ab1e1e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

#searchForm button:hover {
    background: #8b1818;
    box-shadow: 0 0 8px rgba(171, 30, 30, 0.5);
}

.carousel-container {
    overflow: hidden;
    width: 100%;
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
}

/* Bandet — håller alla kort */
#carousel {
    display: flex;
    gap: 40px;
    width: fit-content;
    align-items: center;
    margin: 0 auto;
}

/* ALLA kort — standard styling */
#carousel .movieCard {
    flex-shrink: 0;
    width: 200px;
    height: 300px;
    opacity: 0.5;
    transform: scale(0.85);
    transition: all 0.3s ease;
    filter: brightness(0.7);
}

/* MITT-kortet — special styling */
#carousel .movieCard.center {
    width: 280px;
    height: 420px;
    opacity: 1;
    transform: scale(1);
    filter: brightness(1);
    box-shadow: 0 8px 24px rgba(171, 30, 30, 0.4);
}

#carousel .movieCard img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

#error {
    background-color: #ff6b35;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    margin: 10px 0;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* RESPONSIVE - MOBIL */
@media (max-width: 768px) {
    .carousel-container {
        height: 300px;
    }
    
    #carousel {
        gap: 20px;
    }
    
    #carousel .movieCard {
        width: 140px;
        height: 210px;
        opacity: 0.5;
        transform: scale(0.8);
    }
    
    #carousel .movieCard.center {
        width: 180px;
        height: 270px;
        opacity: 1;
        transform: scale(1);
    }
    
    #headerTitle {
        font-size: 16px;
        flex-grow: 0;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    
    #homeBtn {
        position: static;
        margin-left: auto;
    }
}