body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

a {
    white-space: nowrap;
}

body {
    font-family:
        'Inter',
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        Oxygen,
        Ubuntu,
        Cantarell,
        'Open Sans',
        'Helvetica Neue',
        sans-serif;
    display: flex;
    flex-direction: column;
    color: #fff;
    text-align: center;
    position: relative;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: rgb(33, 33, 33);
}

.page-background-image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.page-background-image-overlay::before {
    content: '';
    z-index: 10;
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    background: linear-gradient(180deg, #393636 0%, #121212 100%);
    opacity: 0.8;
    backdrop-filter: blur(300px);
    width: 100%;
}

/* Page wrapper - takes all space between top and footer (shared by all templates) */
.card-wrapper,
.bio-card-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 20px;
}

.card {
    background-color: #121212;
    padding: 20px;
    border-radius: 40px;
    width: 100%;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    gap: 20px;
}

.main-image-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #333;
    position: relative;
}

.main-image,
.main-image-color-block {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.main-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #555;
    color: #aaa;
    font-style: italic;
}

.title {
    font-size: 24px;
    font-weight: 900;
    color: #ffffff;
    margin: 0;
}

.description {
    font-size: 14px;
    color: #ccc;
    line-height: 1.5;
    margin: 0;
}

.dsp-button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    margin-top: 20px;
    position: relative;
    max-width: 260px;
}

/* Kompaktare knappar när det finns fler än 3 */
.dsp-button-container.has-many-buttons {
    gap: 10px;
    margin-bottom: 0px;
}

.dsp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #1db954;
    color: #000000;
    padding: 10px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width: 100%;
    min-width: 250px;
    box-sizing: border-box;
    height: 55px;
    overflow: hidden;
}

/* Kompaktare knappar när det finns fler än 3 */
.dsp-button-container.has-many-buttons .dsp-button {
    height: 48px;
    min-height: 48px;
    font-size: 15px;
    padding: 8px;
}

.dsp-button:hover {
    background-color: #1aa34a;
}

.dsp-logo {
    object-fit: contain;
    max-height: 100%;
    max-width: inherit;
}

.sub-text {
    font-size: 10px;
    font-style: italic;
    color: #eaeaea;
    margin: 0;
    text-align: center;
    margin-top: 20px;
}

.save-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #eaeaea;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    margin-top: 15px;
    padding: 6px 0;
    transition: opacity 0.2s ease;
}

.save-button:hover {
    opacity: 0.7;
}

.plus-icon {
    font-size: 16px;
    vertical-align: middle;
    line-height: 1.4;
    font-style: normal;
}

footer {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    flex-direction: column;
    gap: 5px;
}

footer p {
    margin: 0;
}

footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: underline;
    text-underline-offset: 2px;
    margin: 0 5px;
    cursor: pointer;
    white-space: nowrap;
}

.manage-permission-text {
    margin-top: 30spx;
}

.text-content-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (min-width: 950px) {
    .card {
        flex-direction: row;
        align-items: center;
        padding: 30px;
        width: auto;
        max-width: 1620px;
        gap: 30px;
    }

    .main-image-container {
        width: 350px;
        height: 350px;
    }

    .text-content-container {
        max-width: 450px;
        width: 450px;
    }

    .title {
        font-size: 32px;
    }

    .description {
        font-size: 16px;
    }

    .dsp-button-container {
        max-width: 400px;
    }

    .dsp-button {
        min-width: 200px;
        max-width: 400px;
        font-size: 18px;
        height: 80px;
        min-height: 80px;
        padding: 15px;
    }

    /* Kompaktare på desktop också när många knappar */
    .dsp-button-container.has-many-buttons .dsp-button {
        height: 65px;
        min-height: 65px;
        font-size: 16px;
        padding: 12px;
    }

    .sub-text {
        max-width: 100%;
    }

    footer {
        margin-top: 20px;
    }

    /* When content is taller than viewport, align image to top */
    @container wrapper (min-height: 100dvh) {
        .card {
            justify-content: flex-start;
        }

        .main-image-container {
            margin-top: 0;
            margin-bottom: auto;
        }
    }
}

/* --- Cookie Consent Modals --- */
.cookie-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.cookie-modal {
    position: relative;
    padding: 25px 30px;
    background-color: #181818;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    max-width: 550px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    z-index: 10001;
}

.cookie-modal-title {
    margin-top: 0;
    color: #ffffff;
    font-size: 20px;
    margin-bottom: 15px;
}

.cookie-modal-body {
    font-size: 14px;
    line-height: 1.7;
    color: #b3b3b3;
    margin-bottom: 20px;
}

.cookie-modal-body br {
    display: block;
    margin: 10px 0;
}

.cookie-modal-body a {
    color: #1db954;
    text-decoration: underline;
}

.cookie-modal-actions {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.cookie-modal-button {
    padding: 12px 25px;
    background-color: #1db954;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 15px;
    width: 100%;
    max-width: 350px;
}

.cookie-modal-button--secondary {
    background-color: #6c757d;
}

.cookie-modal-button--danger {
    background-color: #dc3545;
}

.cookie-modal-link {
    color: #ffffff;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    opacity: 0.8;
}

.cookie-modal-close {
    position: absolute;
    top: 10px;
    left: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: rgb(84, 84, 84);
    cursor: pointer;
    line-height: 1;
}

.cookie-modal-actions--horizontal {
    flex-direction: row;
    justify-content: center;
}

.cookie-modal-actions--horizontal .cookie-modal-button {
    width: auto;
    font-size: 14px;
    padding: 10px 20px;
}

/* --- Ladda-indikator för knappar --- */
.cookie-modal-button.is-loading {
    color: transparent !important;
    pointer-events: none;
    position: relative;
}

.cookie-modal-button.is-loading .loader {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Styling för Custom Button med logga och text */
.dsp-button.dsp-button--custom-logo-and-text {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
}

.dsp-button--custom-logo-and-text .dsp-button-logo-square {
    height: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px 0 0 50px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.dsp-button--custom-logo-and-text .dsp-button-text {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dsp-button--custom-logo-and-text .dsp-logo-small {
    max-height: 80%; /* Begränsa loggans höjd */
    max-width: 80%; /* Begränsa loggans bredd */
    object-fit: contain;
}

.dsp-button .dsp-logo-full {
    max-height: 100%;
    max-width: 80%; /* Begränsa bredden lite så den inte går kant-i-kant */
    object-fit: contain;
}

/* Styling för bara text (om det behövs) */
.dsp-button.dsp-button--custom-text-only span,
.dsp-button.dsp-button--fallback-text span {
    margin: auto; /* Centrera texten om ingen logga finns */
}

/* Behåll befintliga .dsp-logo stilar för fallback eller justera vid behov */
.dsp-logo {
    object-fit: contain;
    max-height: 100%;
    /* max-width: inherit; Kanske ta bort denna? */
}
