.visual-category-type-container {
    width: 100%;
    display: flex;
    height: fit-content;
    justify-content: center;
    flex-direction: row;
    gap: 1em;
    padding-right: 1em;
}

.visual-category-type-container .visual-category-type {
    width: 25%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* height: fit-content; */
    border-radius: 10px;
    border: 4px solid var(--border-color);
    position: relative;
    padding: 1em 1em;
    gap: 0.3em;
    cursor: pointer;
    text-align: start;
}

.visual-category-type-container .visual-category-type:hover {
    border: 4px solid white;
}

.visual-category-type-container .visual-category-type.selected {
    background-color: var(--main-color-background);
    border: 4px solid white;
}


.visual-category-type-container .visual-category-type .visual-category-type-title {
    color: var(--font-color);
    font-size: 0.8em;
    width: 100%;
}

.visual-category-type-container .visual-category-type .visual-category-type-description {
    color: var(--font-color-50);
    font-size: 0.7em;
    font-weight: 600;
    width: 100%;
}


.gallery-container {
    position: relative;
    height: 250px;
    margin-bottom: 60px;
    perspective: 1000px;
    width: 100%;
    z-index: 1;
    display: flex;
    justify-content: center;
}

.gallery-row {
    position: relative;
    height: 240px;
    width: 80%;
    margin-bottom: 40px;
}

.image-card {
    position: absolute;
    width: 220px;
    height: 240px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transform-style: preserve-3d;
    transform: rotateY(var(--rotateY, -5deg)) rotateX(var(--rotateX, 5deg));
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    z-index: 1;
    border: 7px solid #272727bd;
}

@media (max-width: 786px) {
    .image-card {
        width: 187px;
        height: 204px;
    }
}

.image-card p {
    position: absolute;
    bottom: 0.2em;
    left: 0.5em;
    z-index: 2;
    font-weight: 600;
}

.selected-image-card {
    border-color: white !important;
    z-index: 10 !important;
}

.image-card:hover {
    transform: rotateY(0) rotateX(0) scale(1.1) translateZ(30px);
    z-index: 100;
    /* Significantly higher z-index to ensure it's above all other cards */
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 0 30px rgba(128, 0, 255, 0.3);
}

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

/* Top row positioning */
.gallery-row:first-child .image-card:nth-child(1) {
    left: 0px;
    transform: rotateY(-5deg) rotateX(3deg);
    z-index: 3;
}

.gallery-row:first-child .image-card:nth-child(2) {
    left: 180px;
    transform: rotateY(2deg) rotateX(-2deg);
    z-index: 2;
}

.gallery-row:first-child .image-card:nth-child(3) {
    left: 360px;
    transform: rotateY(-3deg) rotateX(1deg);
    z-index: 4;
}

.gallery-row:first-child .image-card:nth-child(4) {
    left: 540px;
    transform: rotateY(4deg) rotateX(-3deg);
    z-index: 1;
}

.gallery-row:first-child .image-card:nth-child(5) {
    left: 720px;
    transform: rotateY(0deg) rotateX(2deg);
    z-index: 2;
}

.gallery-row:first-child .image-card:nth-child(6) {
    left: 900px;
    transform: rotateY(-3deg) rotateX(0deg);
    z-index: 3;
}

.gallery-row:first-child .image-card:nth-child(7) {
    left: 1080px;
    transform: rotateY(2deg) rotateX(-6deg);
    z-index: 1;
}

/* Bottom row positioning */
/* .gallery-row:last-child .image-card:nth-child(1) {
    left: 70px;
    transform: rotateY(3deg) rotateX(-1deg);
    z-index: 2;
}

.gallery-row:last-child .image-card:nth-child(2) {
    left: 250px;
    transform: rotateY(-2deg) rotateX(2deg);
    z-index: 3;
}

.gallery-row:last-child .image-card:nth-child(3) {
    left: 430px;
    transform: rotateY(5deg) rotateX(-2deg);
    z-index: 1;
}

.gallery-row:last-child .image-card:nth-child(4) {
    left: 610px;
    transform: rotateY(-4deg) rotateX(3deg);
    z-index: 2;
} */

@media (max-width: 786px) {
    .gallery-container {
        height: 700px;
        margin-bottom: 0;
    }

    .gallery-row {
        height: 400px;
    }

    .image-card {
        width: 180px;
        height: 200px;
    }

    /* Top row responsive positioning */
    .gallery-row:first-child .image-card:nth-child(1) {
        left: -10px;
        top: 0;
    }

    .gallery-row:first-child .image-card:nth-child(2) {
        left: 160px;
        top: 0;
    }

    .gallery-row:first-child .image-card:nth-child(3) {
        left: -5px;
        top: 180px;
    }

    .gallery-row:first-child .image-card:nth-child(4) {
        left: 150px;
        top: 180px;
    }

    .gallery-row:first-child .image-card:nth-child(5) {
        left: 0px;
        top: 400px;
    }

    .gallery-row:first-child .image-card:nth-child(6) {
        left: 160px;
        top: 360px;
    }

    .gallery-row:first-child .image-card:nth-child(7) {
        left: 0px;
        top: 580px;
    }

    /* Bottom row responsive positioning */
    /* .gallery-row:last-child .image-card:nth-child(1) {
        left: 0;
        top: 0;
    }

    .gallery-row:last-child .image-card:nth-child(2) {
        left: 150px;
        top: 0;
    }

    .gallery-row:last-child .image-card:nth-child(3) {
        left: 50px;
        top: 180px;
    }

    .gallery-row:last-child .image-card:nth-child(4) {
        left: 200px;
        top: 180px;
    } */
}




















/* Audio */
.audio-carousel {
    position: relative;
    height: 150px;
    overflow: visible;
    width: 100%;
    /* margin: 0px 80px; */
    /* perspective: 1000px; */
    z-index: 1;
    display: flex;
    justify-content: center;
}

.audio-row {
    position: relative;
    height: 100%;
    width: 80%;
    /* margin-bottom: 40px; */
}

.selected-audio-card {
    border-width: 5px !important;
    border-color: white !important;
    z-index: 10 !important;
}

.audio-card {
    position: absolute;
    width: 240px;
    height: 130px;
    background: linear-gradient(135deg, #1e1e2e, #2d2d44);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transform-style: preserve-3d;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}


.audio-card:hover {
    transform: rotateY(0) rotateX(0) scale(1.1) translateZ(30px);
    z-index: 100;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        0 0 30px rgba(128, 0, 255, 0.3);
}

.voice-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.voice-details {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.audio-controls {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.play-button {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.play-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 14px;
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.9);
    margin-left: 3px;
}

.pause-icon {
    display: none;
    width: 14px;
    height: 14px;
    position: relative;
}

.pause-icon:before,
.pause-icon:after {
    content: '';
    width: 4px;
    height: 14px;
    background-color: rgba(255, 255, 255, 0.9);
    position: absolute;
    top: 0;
}

.pause-icon:before {
    left: 1px;
}

.pause-icon:after {
    right: 1px;
}

.audio-waveform {
    flex-grow: 1;
    height: 40px;
    position: relative;
    display: flex;
    align-items: center;
}

.wave-bar {
    width: 3px;
    background-color: rgba(255, 255, 255, 0.2);
    margin-right: 3px;
    height: 100%;
    transform-origin: bottom;
    animation: none;
    border-radius: 2px;
}

.audio-controls.playing .wave-bar {
    animation: wave-animation 1s infinite ease-in-out;
}

.audio-card .gender-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.male .gender-tag {
    background-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.female .gender-tag {
    background-color: rgba(219, 39, 119, 0.3);
    color: #fbcfe8;
}

.neutral .gender-tag {
    background-color: rgba(139, 92, 246, 0.3);
    color: #ddd6fe;
}

@keyframes wave-animation {
    0% {
        height: 10%;
    }

    20% {
        height: var(--random-height);
    }

    40% {
        height: 20%;
    }

    60% {
        height: var(--random-height);
    }

    80% {
        height: 30%;
    }

    100% {
        height: 10%;
    }
}

/* Card positioning */
.audio-card:nth-child(1) {
    right: 720px;
    transform: rotateY(-5deg) rotateX(3deg);
    z-index: 5;
}

.audio-card:nth-child(2) {
    right: 540px;
    transform: rotateY(2deg) rotateX(-2deg);
    z-index: 4;
}

.audio-card:nth-child(3) {
    right: 360px;
    transform: rotateY(-3deg) rotateX(1deg);
    z-index: 3;
}

.audio-card:nth-child(4) {
    right: 180px;
    transform: rotateY(4deg) rotateX(-3deg);
    z-index: 2;
}

.audio-card:nth-child(5) {
    right: 0px;
    transform: rotateY(-2deg) rotateX(2deg);
    z-index: 1;
}

/* 
.audio-controls.playing {
    border: 1px solid rgba(128, 0, 255, 0.5);
    box-shadow: 0 0 20px rgba(128, 0, 255, 0.5);
} */

.audio-controls.playing .play-icon {
    display: none;
}

.audio-controls.playing .pause-icon {
    display: block;
}

/* Accent colors for cards */
.audio-card:nth-child(1) {
    background: linear-gradient(135deg, #1e1e2e, #2d2d44);
}

.audio-card:nth-child(2) {
    background: linear-gradient(135deg, #1f2937, #293548);
}

.audio-card:nth-child(3) {
    background: linear-gradient(135deg, #312e81, #3730a3);
}

.audio-card:nth-child(4) {
    background: linear-gradient(135deg, #4c1d95, #6d28d9);
}

.audio-card:nth-child(5) {
    background: linear-gradient(135deg, #831843, #be185d);
}

/* Language tag styling */
.language-tag {
    position: absolute;
    bottom: 15px;
    right: 15px;
    font-size: 0.7rem;
    font-weight: 500;
    display: flex;
    gap: 0.5em;
    color: rgba(255, 255, 255, 0.6);
}

.language-tag img {
    width: 1em;
    height: auto;
}

@media (max-width: 880px) {
    .audio-carousel {
        height: 400px;
    }

    .audio-card {
        width: 220px;
    }

    .audio-card:nth-child(1) {
        left: 0;
        top: 0;
    }

    .audio-card:nth-child(2) {
        left: 80px;
        top: 110px;
    }

    .audio-card:nth-child(3) {
        left: 10px;
        top: 220px;
    }

    .audio-card:nth-child(4) {
        left: 60px;
        top: 330px;
    }

    .audio-card:nth-child(5) {
        left: 0px;
        top: 440px;
    }
}





/* --- Script Section Styles --- */
#script-section {
    margin-bottom: 60px;
    /* Space before next section */
}

.script-editor-area {
    /* padding: 30px; */
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    width: 80%;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: start;
}

.script-textarea {
    min-height: 80px;
    /* Good default height */
    background-color: transparent;
    color: rgba(255, 255, 255, 0.9);
    border: 2px solid #272727bd;
    border-radius: 8px;
    padding: 20px;
    backdrop-filter: blur(3px);
    font-size: 1rem;
    line-height: 1.7;
    resize: vertical;
    /* Allow vertical resizing */
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.script-textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.script-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    /* Purple accent on focus */
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(128, 0, 255, 0.2);
}

.script-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    width: 80%;
}

.word-count {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.riz-button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #5808d6, #3d0ca5);
    /* Vibrant purple */
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(88, 8, 214, 0.3);
}

.riz-button:hover {
    background: linear-gradient(135deg, #6a1bf0, #4a10c2);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(88, 8, 214, 0.4);
}

.riz-button:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 3px 10px rgba(88, 8, 214, 0.3);
}

/* --- End Script Section Styles --- */





#generate-content {
    gap: 0em !important;

}

.notification-msg {
    position: absolute;
    right: 0;
    top: -2em;
    border-bottom-left-radius: 7px;
    border-bottom-right-radius: 7px;
    padding: 0.1em 0.5em;
    background-color: rgb(0, 255, 0, 0.1);
    border: 1px solid rgb(0, 255, 0, 0.4);
    border-bottom: none;
    color: rgb(0, 255, 0);
    font-size: 0.5em;
}


#generate-content button {
    /* height: 7em; */
    /* width: 7em; */
    border: 4px solid #272727bd;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1;
    background-color: transparent;
    padding: 0.6em 1em;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    color: white;
    font-size: 1.4em;
    gap: 0.7em;
    backdrop-filter: blur(3px);
}

#generate-content button:hover {
    /* transform: scale(1.1); */
    border-color: var(--accent-color);
}

#generate-content button img {
    width: 1.5em;
    height: auto;
}


.sign-up-required {
    position: absolute;
    right: 0;
    top: -2em;
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
    padding: 0.1em 0.5em;
    background-color: rgb(255, 0, 0, 0.1);
    border: 1px solid rgb(255, 0, 0, 0.4);
    border-bottom: none;
    color: rgb(255, 0, 0);
    font-size: 0.5em;
}


.sign-up-done {
    position: absolute;
    right: 0;
    top: -2em;
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
    padding: 0.1em 0.5em;
    background-color: rgb(0, 255, 0, 0.1);
    border: 1px solid rgb(0, 255, 0, 0.4);
    border-bottom: none;
    color: rgb(0, 255, 0);
    font-size: 0.5em;
}










/* Captions */
.captions-container {
    position: relative;
    height: 250px;
    margin-bottom: 60px;
    perspective: 1000px;
    width: 100%;
    z-index: 1;
    display: flex;
    justify-content: center;
}


.captions-option-container {
    width: 40%;
    height: 100%;
    position: relative;
}

.captions-option-card {
    position: absolute;
    width: 240px;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transform-style: preserve-3d;
    transform: rotateY(var(--rotateY, -5deg)) rotateX(var(--rotateX, 5deg));
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    z-index: 1;
    border: 7px solid #272727bd;
    display: flex;
    align-items: center;
    background-color: var(--base-color);
}

.captions-option-card canvas {
    height: auto;
    width: 100%;
    aspect-ratio: 1920/1080;
}

.captions-preview-container canvas {
    height: 100%;
    width: auto;
    aspect-ratio: 1920/1080;
}


@media (max-width: 786px) {
    .captions-container {
        flex-direction: column;
        height: 400px;
    }

    .captions-option-card {
        width: 162px;
        height: 135px;
    }

    .captions-preview-container canvas {
        width: 100%;
        height: auto;
    }
}


.selected-caption-card {
    border-color: white !important;
    z-index: 10 !important;
}

.captions-option-card:hover {
    transform: rotateY(0) rotateX(0) scale(1.1) translateZ(30px);
    z-index: 100;
    /* Significantly higher z-index to ensure it's above all other cards */
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 0 30px rgba(128, 0, 255, 0.3);
}

.captions-option-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Top row positioning */
.captions-option-container:first-child .captions-option-card:nth-child(1) {
    left: 0px;
    transform: rotateY(-5deg) rotateX(-4deg);
    z-index: 3;
}

.captions-option-container:first-child .captions-option-card:nth-child(2) {
    left: 230px;
    transform: rotateY(2deg) rotateX(10deg);
    z-index: 2;
}

.captions-preview-container {
    width: 40%;
    height: 100%;
}


@media (max-width: 786px) {
    .captions-option-container:first-child .captions-option-card:nth-child(1) {
        left: 10px;
        transform: rotateY(-5deg) rotateX(-4deg);
        z-index: 3;
    }

    .captions-option-container:first-child .captions-option-card:nth-child(2) {
        left: 190px;
        transform: rotateY(2deg) rotateX(10deg);
        z-index: 2;
    }

    .captions-preview-container {
        width: 90%;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
    }

}



.loader {
    position: relative;
    border: 0.2em solid var(--background-color);
    border-top: 0.2em solid rgb(255, 255, 255, 0.9);
    border-right: 0.2em solid rgb(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 1.2em;
    height: 1.2em;
    -webkit-animation: spin 2s linear infinite;
    animation: spin 0.5s linear infinite;
}


@-webkit-keyframes spin {
    0% {
        -webkit-transform: rotate(0deg);
    }

    100% {
        -webkit-transform: rotate(360deg);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}



#generated-video-preview {
    width: 100%;
    height: 35em;
    z-index: 1;
    display: none;
}

#generated-video-preview video {
    height: 100%;
    width: auto;
    border-radius: 15px;
    border: 2px solid var(--border-color);
    padding: 1em;
}