@font-face {
    font-family: "Newake";
    src: url("./fonts/newake.woff") format("woff");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "Gilroy";
    src: url("./fonts/GILROY-BOLD.woff") format("woff");
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: "Gilroy";
    src: url("./fonts/GILROY-EXTRABOLD.woff") format("woff");
    font-weight: 700;
    font-style: normal;
}

body {
    font-family: "Newake", Arial, sans-serif;
    background: #f8f8f8;
    /* display: flex; */
    justify-content: center;
    text-align: center;
    margin-top: 20px;
}

form {
    margin-bottom: 20px;
}

#work-area {
    display: flex;
    justify-content: center;

    #flyer {
        width: 1080px;
        height: 1440px;
        position: relative;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        z-index: 0;

        #bandavertical {
            position: absolute;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 430px;
            height: 100%;
            background: #043f61;
            margin: 0;
            display: block;
            pointer-events: auto;
            z-index: 1;
            /*  TODO: Comentado porque solo se ve en la vista previa
                Habría que decidir si se saca o se deja
                Hay que investigar el tema de mask con html2canvas
            mask-image: url("images/texture.png"), url("images/ruido.png");
            mask-repeat: repeat, repeat;
            mask-size: cover, auto 2.5%;
            -webkit-mask-image: url("images/texture.png"), url("images/ruido.png");
            -webkit-mask-repeat: repeat, repeat;
            -webkit-mask-size: cover, auto 2.5%;
            mask-composite: intersect;
            */

            &::after {
                content: "";
                position: absolute;
                top: 0; left: 0; 
                width: 100%; height: 100%;
                pointer-events: none;
                background: url("images/ruido.png");
                opacity: 0.20;
            }
        }

        .v-box {
            width: 100%;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10;
            pointer-events: none; /* Para debug de cajas comentar */ 
        }

        #header {
            height: 180px;
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: auto;
            z-index: 1;

            &::after {
                content: "";
                position: absolute;
                top: 10px; left: 0; 
                width: 100%; height: 160px;
                background: url("images/ruido.png");
                opacity: 0.20;
                pointer-events: none;
                z-index: 2;
            }

            &.with-background-color::after {
                top: 0;
                height: 100%;
            }

            #tape {
                position: absolute;
                top: 10px; left: 0;
                width: 100%; height: 160px;
                object-fit: fill;
                margin: 0;
                display: block;
                pointer-events: auto;
                z-index: 3;
            }

            .header-text {
                display: inline-block;
                width: 900px;
                height: 100px;
                padding: 0;
                font-size: 124px;
                line-height: 1;
                z-index: 3;
                position: relative;
                margin: 0;
                pointer-events: auto;
            }
        }

        #subheader {
            height: 170px;
            
            #ciclo-wrapper {
                position: relative;
                top: 10px;
                display: flex;
                width: max-content;
                max-width: 960px;
                padding: 16px 32px;
                align-items: center;
                justify-content: center;

                #ciclo-bg {
                    position: absolute;
                    top: 0;
                    left: 0;
                    width: 100%;
                    height: 100%;
                    border-radius: 10px;
                    background-color: #ffffff;
                    opacity: 0.6;
                    pointer-events: auto;
                }

                #ciclo {
                    position: relative;
                    margin: 0;
                    font-size: 30px;
                    font-family: "Gilroy", sans-serif;
                    text-align: center;
                    word-break: break-word;
                    white-space: normal;
                    color: #000000;
                    pointer-events: auto;
                }

                #bubble {
                    position: absolute;
                    top: -85px;
                    right: max(-150px, calc(50% - 500px));
                    width: 240px; 
                    height: 100px;
                    display: flex;
                    align-items: center; 
                    justify-content: center;
                    z-index: 99;
                    pointer-events: auto;

                    #bubble-bg {
                        position: absolute;
                        top: 0; left: 0;
                        width: 100%; height: 100%;
                        z-index: 1;
                        pointer-events: none;
                    }

                    .comic-text {
                        font-family: "Gilroy", sans-serif;
                        font-size: 28px;
                        font-weight: 650;
                        color: #000000;
                        position: relative;
                        z-index: 2;
                        margin-bottom: 20px;
                    }
                }
            }
        }

        #poster-container {
            height: 810px;

            #poster {
                height: 100%;
                border-radius: 10px;
                position: relative;
                object-fit: contain;
                pointer-events: auto;
            }
        }

        #flyer-row {
            height: 220px;
            justify-content: space-between;
            gap: 20px;
            box-sizing: border-box;
            padding: 0 40px;

            .flyer-date-group,
            .flyer-main-group,
            .flyer-biblioteca-group {
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                height: 100%;
            }

            .flyer-date-group {
                flex: 1;
                position: relative;

                .flyer-date,
                .flyer-hour {
                    text-align: center;
                    width: 100%;
                    font-family: "Gilroy", sans-serif;
                    font-weight: 700;
                    pointer-events: auto;
                }

                .flyer-date { font-size: 34px; }
                .flyer-hour { font-size: 40px; }
            }

            .flyer-main-group {
                flex: 2;
                gap: 6px;

                #title, #year, #director, #duracion, #edad-sugerida {
                    font-family: "Gilroy", sans-serif;
                    font-weight: 700;
                    position: relative;
                    margin: 0;
                    line-height: 1;
                    pointer-events: auto;
                }

                #title {
                    font-size: 42px;            
                    max-width: 500px;
                    word-break: break-word;
                }

                #year { font-size: 32px; }

                #director { font-size: 26px; }

                #duracion { font-size: 22px; }

                #edad-sugerida {
                    font-size: 20px;
                    color: white;
                    background-color: rgba(199, 194, 194, 0.9);
                    padding: 3px 8px;
                    border-radius: 4px;
                }
            }

            .flyer-biblioteca-group {
                flex: 1;
                position: relative;
                gap: 10px;
                
                img {
                    height: 130px;
                    width: auto;
                    object-fit: contain;
                    display: block;
                    pointer-events: auto;
                }

                .biblioteca-text {
                    height: 60px;
                    font-family: "Gilroy", sans-serif;
                    color: #ca550b;
                    font-size: 28px;
                    font-weight: 700;
                    text-align: center;
                    line-height: 1;
                    flex-shrink: 0;
                    pointer-events: auto;
                }
            }
        }

        #event-data {
            height: 60px;

            #bandahorizontal {
                position: absolute;
                top: 0; left: 0;
                width: 100%; height: 100%;
                background: #043f61;
                margin: 0;
                display: block;
                pointer-events: auto;

                &::after {
                    content: "";
                    position: absolute;
                    top: 0; left: 0; width: 100%; height: 100%;
                    background: url("images/ruido.png");
                    opacity: 0.20;
                }
            }

            #org {
                width: 100%;
                display: block;
                text-align: center;
                position: relative;
                font-family: "Gilroy", sans-serif;
                font-weight: 600;
                font-size: 21px;
                margin: 0;
                z-index: 2;
                pointer-events: auto;
            }
        }
    }
}

/* Clase para el fondo difuminado del flyer */
.flyer-blur-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 102%;
    height: 102%;
    z-index: 0;
    pointer-events: none;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    filter: blur(4px) brightness(0.9);
}

.instrucciones {
    font-family: "Gilroy", sans-serif;
    margin-bottom: 10px;
}

#movie-results {
    font-family: "Gilroy", sans-serif;
}

#movieSearch,
#movieLanguage {
    margin-bottom: 10px;
}

#saveFlyer {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
}

.flyer-flex-col hr {
    align-self: stretch;
}

hr {
    width: 100%;
    border: none;
    border-top: 2px solid #ccc;
    margin: 24px 0;
    display: block;
}

button {
    font-size: 14px;
    cursor: pointer;
    display: block;
    margin-top: 20px;
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
    padding: 10px 20px;
}

#backdrop-direct-input,
#poster-direct-input {
    border: 2px solid #386119;
    border-radius: 4px;
    font-family: "Gilroy", sans-serif;
    font-size: 14px;
    width: 500px;
    margin-bottom: 5px;
    padding: 5px;
}

#backdrop-direct-input:focus,
#poster-direct-input:focus {
    outline: none;
    border-color: #2a4612;
    box-shadow: 0 0 5px rgba(56, 97, 25, 0.3);
}

#backdrop-carousel-img,
#poster-carousel-img {
    max-width: 640px;
    max-height: 360px;
    border: 1px solid #ccc;
    background: #eee;
    cursor: pointer;
    transition: opacity 0.2s;
}

#backdrop-carousel-img:hover,
#poster-carousel-img:hover {
    opacity: 0.8;
}

.carousel-arrow-button {
    font-size: 1.5em;
}

.carousel-counter {
    margin-top: 8px;
    font-size: 1rem;
    color: #555;
}

#remove-backdrop-bg {
    margin-top: 5px;
    font-size: 1rem;
}

#posters {
    margin-bottom: 10px;
    display: inline-block;
    text-decoration: underline;
    color: #1976d2;
    cursor: pointer;
}

#image-info-modal input[readonly] {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

#image-info-modal button {
    background: #386119;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: "Gilroy", sans-serif;
}

#image-info-modal button:hover {
    background: #2a4612;
}

#image-info-modal button#close-modal {
    background: #666;
}

#image-info-modal button#close-modal:hover {
    background: #444;
}

#panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-left: 10px;
    align-items: start;
    padding: 14px;
    border-radius: 12px;
    background: #14181e;
    color: #dbe5ee;
    /* max-height: 940px; */
    font-family: "Gilroy", sans-serif;
}

#panel label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
    margin-right: 10px;
    justify-self: left;
}

#panel input[type="text"],
#panel input[type="number"] {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #29303a;
    background: #101419;
    color: #e8f1ff;
}

#panel select {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #29303a;
    background: #e8f1ff;
    color: #101419;
    font-family: "Gilroy", sans-serif;
    font-size: 16px;
}

#panel select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

#panel input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

#panel input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}

#panel input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 8px;
}

#panel button {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #283241;
    background: #1a2430;
    color: #e8f1ff;
    cursor: pointer;
    font-weight: 700;
}

#browsers-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.browser {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
    padding: 8px 12px;
    background-color: #555;
    color: white;
    font-family: "Gilroy", sans-serif;
    display: flex;
    align-items: center;
}

.browser-ok {
    padding: 8px 12px;
    background-color: #4caf50;
    color: white;
    font-family: "Gilroy", sans-serif;
    margin-right: 10px;
    height: 28px;
    display: flex;
    align-items: center;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}

.browser-x {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    height: 28px;
    padding: 8px 12px;
    background-color: #f44336;
    color: white;
    font-family: "Gilroy", sans-serif;
    margin-right: 10px;
    display: flex;
    align-items: center;
}

.browser-logo {
    width: 28px;
    height: 28px;
    vertical-align: middle;
    margin-right: 8px;
}

.edad-sugerida-input {
    display: flex;
    flex-direction: column;
}

/* Botones de importar/exportar */
#import-export-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #29303a;
    width: 100%;
}

#exportDataBtn {
    background-color: #4caf50 !important;
    color: white !important;
    border: 1px solid #4caf50 !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    font-family: "Gilroy", sans-serif !important;
    transition: background-color 0.2s ease;
}

#exportDataBtn:hover {
    background-color: #45a049 !important;
    border-color: #45a049 !important;
}

#importDataBtn {
    background-color: #2196f3 !important;
    color: white !important;
    border: 1px solid #2196f3 !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    font-family: "Gilroy", sans-serif !important;
    transition: background-color 0.2s ease;
}

#importDataBtn:hover {
    background-color: #1976d2 !important;
    border-color: #1976d2 !important;
}

.movie-item-alternating {
    width: 900px;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 250px;
}

@media (max-width: 768px) {
    .movie-item-alternating {
        flex-direction: column !important;
        text-align: center !important;
        margin: 0 auto 25px auto !important;
    }

    .movie-item-alternating img {
        margin: 0 0 15px 0 !important;
    }

    .movie-date-individual {
        margin: 0 0 15px 0 !important;
    }
}

.movie-date-individual {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

#paintPaletteContainer {
    /* position: fixed; */
    /* bottom: 30px; */
    /* left: 50%; */
    /* transform: translateX(-50%); */
    /* background-color: #fff; */
    /* padding: 15px 25px; */
    /* border-radius: 30px; */
    /* box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3); */
    /* z-index: 10000; */
    align-items: center;
    /* gap: 15px; */
    /* border: 2px solid #333; */
}
#paintColorInput {
    cursor: pointer;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    padding: 0;
}

.paint-mode-highlight {
    outline: 3px dashed #ff007f !important;
    outline-offset: 2px !important;
    cursor: crosshair !important;
    transition: outline 0.1s ease-in-out;
}

#backdrops {
    margin-bottom: 10px;
    display: inline-block;
    text-decoration: underline;
    color: #1976d2;
    cursor: pointer;
}
