/* Formatage globale de la page */
:root {
    --main-font: Poppins, sans-serif;
    --second-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --base-font-size: 1rem;
    --main-text-color: #ffffff;
    --secondary-text-color: #000000;
    --third-text-color: #164fac;
    --text-hover-color: #5581cc;
    --dark-text-color: rgba(0, 0, 0, 0.799);
    --dark-primary-color: rgba(0, 0, 0, 0.195);
    --dark-secondary-color: rgba(0, 0, 0, 0.088);
    --dark-third-color: rgba(0, 0, 0, 0.519);
    --red-color: rgba(255, 0, 0, 0.711);
    --logo-font: system-ui, -apple-system, sans-serif;
}
button:active {
    animation: fade-out 0.3s ease forwards;
}

@keyframes fade-out {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0.5;
        transform: scale(0.95);
    }
}
* {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    box-sizing: border-box;
    /* Pour cacher la barre de défilement */
    scrollbar-width: none; /* firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}
/* Pour cacher la barre de défilement pour les navigateurs WebKit(modernes) */
::-webkit-scrollbar {
    width: 0; /* Pour cacher la barre de défilement verticale */
    height: 0; /* Pour cacher la barre de défilement horizontale */
}
html {
    font-size: var(--base-font-size);
    font-family: var(--main-font);
}
body {
    min-height: 100vh;
    min-width: 100vw;
    display: flex;
    flex-direction: column;
}
header {
    position: relative;
}

/* Header background blur */
header::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; 
    height: 100%;
    background-image: url('../../images/pexels-googledeepmind-17483870.webp');
    background-size: cover;
    background-position: center;
    filter: blur(15px);
    z-index: -1;
    clip-path: inset(0 0 0 0);
}

/* Section OCR Project */
#ocr-project {
    font-family: var(--main-font);
    line-height: 1.5;
    padding: 20px;
    margin-top: 60px;
}

#ocr-project h2 {
    line-height: 1.2;
    font-size: 1.5em;
    margin-bottom: 5px;
    color: var(--dark-text-color);
}
#ocr-project h3 {
    font-size: 1.2em;
    margin: 20px 0 0 0;
    color: var(--dark-text-color);
}
#ocr-project p {
    margin: 0px;
    font-size: 1em;
}
#ocr-project ul {
    margin: 0 10px 10px 0px;
    padding-left: 20px;
    list-style: disc inside;
}
#ocr-project li {
    margin: 0;
    line-height: 1.7;
}
#ocr-project strong {
    color: var(--dark-text-color);
}


/* Demo video section */
.demo-video-section {
    background: linear-gradient(to bottom, #7a7a7a0e 0%, var(--third-text-color) 100%);
    margin: 0;
    height: 450px;
    width: 100%;
    color: var(--main-text-color);
    padding: 0px 20px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: flex-start;
}
.demo-content {
    padding: 0 20px;
}
.demo-content h3 {
    font-size: 2rem;
    margin: 10px 0px 10px 0px;
    color: var(--dark-text-color);
    font-size: 1.5em;
}
.demo-content p {
    font-size: 1em;
    margin: 0px;
    max-width: 800px;
    line-height: 1.5;
}
.video-container {
    width: 900px;
    height: 80%;
    margin: 0 ;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.video-container::before {
    content: '';
    display: block;
    padding-bottom: 56.25%;
}
.video-container:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
}
.video-thumbnail {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background-color: var(--main-text-color);
    border-radius: 10px;
    width: 100%;
}
.video-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.9;
}
.video-thumbnail:hover img {
    transform: scale(1.05);
    opacity: 1;
}
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}
.video-thumbnail:hover .play-overlay {
    background: rgba(0,0,0,0.2);
}
.play-button {
    transform: scale(1);
    transition: transform 0.2s ease;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}
.play-button:hover {
    transform: scale(1.1);
}
.video-badge {
    position: absolute;
    top: 85px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: var(--third-text-color);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.video-badge .fas {
    color: var(--third-text-color);
}
.video-badge i {
    color: var(--third-text-color);
}
.video-title-overlay {
    position: absolute;
    bottom: 10px;
    left: 15px;
    color: white;
    text-shadow: 0 2px 8px #000;
}
.video-title-overlay h4 {
    margin-bottom: 2px;
}
.youtube-iframe {
    top: 0;
    left: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    border: none;
}
@media (max-width: 768px) {
    .demo-video-section {
        height: 400px;
    }
    .demo-content p {
        font-size: 1rem;
    }
    .youtube-iframe {
        height: 250px;
    }
    .video-badge {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}
@media (max-width: 600px) {
    .demo-video-section {
        height: 250px;
    }
}
@media (max-width: 480px) {
    .play-button svg {
        width: 60px;
        height: 60px;
    }
    .youtube-iframe {
        height: 200px;
    }
}
main {
    padding: 30px;
}
form {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content:flex-start;
    width: 100%;
    border-top: 3px solid var(--dark-secondary-color);
    border-left: 3px solid var(--dark-secondary-color);
    border-right: 3px solid var(--dark-secondary-color);
    border-bottom: 1px solid var(--dark-secondary-color);
    border-radius: 8px 8px 0 0;
}
.input-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 10px;
    background-color: var(--dark-secondary-color);
    flex: 0 0 40%;
}
.vr-line {
    width: 1px;
    height: 40px;
    background-color: var(--dark-secondary-color);
    margin: 0 20px;
}
.languages-container {
    flex: 1;
    padding: 10px 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}
.src-lang {
    color: var(--dark-third-color);
    border: 1px solid var(--dark-secondary-color);
    padding: 8px 25px;
    font-size: 1.2em;
    font-weight: 500;
    margin-right: 10px;
    border-radius: 5px;
    height: 42px;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.ocr-project i.fas {
    color: var(--dark-primary-color);
    font-size: 1rem;
    margin: 0;
}
.select-wraper {
    border: 1px solid var(--dark-secondary-color);
    border-radius: 5px;
    height: 42px;
    overflow: hidden;
    padding: 0px 15px;
    cursor: pointer;
    border-color: var(--dark-secondary-color);
    margin-left: 10px;
}
.select-wraper:focus-within {
    border-color: var(--third-text-color);
}
#langSelect {
    height: 100%;
    font-size: 1.2em;
    padding-right: 10px;
    border: none;
    background-color: var(--main-text-color);
    color: var(--dark-text-color);
}
#langSelect:focus {
    outline: none;
}

.file-label {
    color: var(--third-text-color);
    border: 2px solid var(--dark-secondary-color);
    font-size: 1.1em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    height: 42px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}
.file-label i {
    margin-right: 10px;
    color: var(--third-text-color);
}
.input-container p {
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--dark-third-color);
    font-size: 1.2em;
    margin-left: 10px;
}
#uploadForm button {
    background: var(--third-text-color);
    color: var(--main-text-color);
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    padding: 8px 18px;
    height: 42px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin: 0 10px;
}
button:hover {
    background: var(--text-hover-color);
}
#result {
    width: 100%;
    height: 600px;
    max-height: 600px;
    border: 3px solid var(--dark-secondary-color);
    border-radius: 0 0px 8px 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
#result div {
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 8px;
    border: 2px dashed var(--dark-secondary-color);
}
#result div > i {
    font-size: 3em;
    color: var(--dark-primary-color);
    margin-bottom: 8px;
}
#result div > h4 {
    color: var(--dark-text-color);
    font-size: 1.3em;
    margin-bottom: 5px;
}
#result div > p {
    color: var(--dark-third-color);
    font-size: 0.8em;
    text-align: center;
    margin-bottom: 2.5px;
}
.upload-image-wraper {
    margin-right: 10px;
}
.result-image-wraper {
    margin-left: 10px;
}


.product-image-zoom {
    position: fixed; top:0; left:0; width:100vw; height:100vh;
    background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center;
    z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.3s;
}
.product-image-zoom.show {
    opacity: 1; 
    visibility: visible; 
}
.product-image-zoom img { 
    max-width: 80vw; 
    max-height: 80vh; 
    border-radius: 10px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}
.zoom-close { 
    position: absolute; 
    top: 20px; 
    right: 30px; 
    color: white; 
    font-size: 40px; 
    cursor: pointer; 
    background:rgba(0,0,0,0.5); 
    border-radius:50%; 
    width:50px; 
    height:50px; 
    display:flex;
    align-items:center;
    justify-content:center; 
}
.zoom-close:hover {
    background: rgba(0,0,0,0.7);
}
.error {
    color: #e74c3c;
    background: #fff0f0;
    padding: 10px;
    border-radius: 6px;
    margin-top: 15px;
}
@media (max-width: 1300px) { 
    #uploadForm {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        padding-right: 10px;
    }
    .vr-line {
        display: none;
    }
    .languages-container {
        padding: 10px;
    }
    #uploadForm button {
        margin: 10px;
    }
}
@media (max-width: 790px) {
    #result {
        flex-direction: column;
        height: auto;
    }
    #result div {
        width: 100%;
        margin: 10px 0;
        height: 300px;
        padding: 0 10px;
    }
    .languages-container {
        margin-top: 10px;
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
}