/* Paleta de Cores Laranja */
:root {
    --orange-dark: #cc5500;
    --orange-medium: #ff8c00;
    --orange-light: #ffb74d;
    --background-dark: #2c2c2c;
    --text-color: #f0f0f0;
    --border-color: #555;
}

/* Estilos Globais e Layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-dark);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

header, main, footer {
    max-width: 960px;
    margin: 0 auto;
    padding: 10px;
}

header {
    text-align: center;
    padding: 5px 20px;
}

h2 {
    color: var(--orange-medium);
    margin-bottom: 10px;
}

h1{
    font-weight: normal;
    font-size: 0.7em;
}

/* Seções de Controle e Galeria */
/* Estilos para a seção de controles */
.controls {
    display: flex;
    flex-direction: column; /* Empilha as divs .drop-zone e .options verticalmente */
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    width: 100%;
    font-size: 2.0em;
}

.options {
    display: flex;
    flex-direction: column; /* MOBILE-FIRST: Empilha os elementos por padrão */
    align-items: center;
    gap: 15px;
    width: 100%;
    font-size: 1.5em;
}

#output-format{
    font-size: 1.0em;    
}
#output-format option{
    font-size: 0.4em;    
}
.gallery-section, .downloads-section {
    margin-top: 40px;
}

h5 {
    color: var(--orange-medium);
    border-bottom: 1px solid var(--orange-dark);
    padding-bottom: 5px;
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* Drag and Drop Area */
.drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    width: 90%;
    max-width: 600px; /* Limitação para telas grandes */
    border: 4px dashed var(--orange-medium);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone.dragover {
    background-color: var(--orange-light);
    border-color: var(--orange-dark);
    color: var(--orange-dark);
}

.drop-zone p {
    margin: 5px 0;
    font-size: 0.6em;
}

.drop-zone input[type="file"] {
    display: none;
}

/* Botões e Inputs */
.button-upload {
    background-color: var(--orange-medium);
    color: var(--background-dark);
    padding: 15px 25px; /* Aumenta o padding para melhor toque */
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.6em; /* Fonte um pouco maior */
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.1s ease;
    width: 90%; /* MOBILE-FIRST: Ocupa a largura total */
}

.button-convert {
    background-color: var(--orange-medium);
    color: var(--background-dark);
    padding: 15px 25px; /* Aumenta o padding para melhor toque */
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em; /* Fonte um pouco maior */
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.1s ease;
    width: 96%; /* MOBILE-FIRST: Ocupa a largura total */
}

.button-cancel {
    background-color: #ff0000 ;
    color: var(--background-dark);
    padding: 15px 25px; /* Aumenta o padding para melhor toque */
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em; /* Fonte um pouco maior */
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.1s ease;
    width: 96%; /* MOBILE-FIRST: Ocupa a largura total */
}

.button-cancel:hover {
    background-color: #8b0000;
    transform: translateY(-2px);
}

.button-cancel:active {
    transform: translateY(0);
}

.button-upload:hover, .button-convert:hover {
    background-color: var(--orange-dark);
    transform: translateY(-2px);
}

.button-upload:active, .button-convert:active {
    transform: translateY(0);
}

select {
    background-color: #444;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    width: 100%; /* MOBILE-FIRST: Ocupa a largura total */
}

/* Galeria de Imagens */
.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.image-frame {
    border: 2px solid var(--orange-dark);
    border-radius: 8px;
    overflow: hidden;
    width: 110px;
    height: 140px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Estilos para o tamanho das imagens */
.image-frame .size-info {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.7em;
    white-space: nowrap;
}

.smaller {
    color: #4CAF50;
}

.larger {
    color: #F44336;
}

.size-info.smaller {
    color: #4CAF50;
}

.size-info.larger {
    color: #F44336;
}

.gallery-info {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1em;
}

/* Área de Download */
.downloads-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.downloads-list a {
    text-decoration: none;
    display: block;
    position: relative;
}

.downloads-list a:hover {
    background-color: transparent;
}

.status-message {
    text-align: center;
    margin-top: 20px;
    font-style: italic;
    color: var(--orange-light);
}

footer {
    text-align: center;
    padding: 20px;
    font-size: 0.8em;
    color: var(--border-color);
    margin-top: 40px;
}

/* Animação de Carregamento */
.loading-frame {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--orange-medium);
    font-size: 0.9em;
    animation: pulse-orange 1.5s infinite alternate;
}

@keyframes pulse-orange {
    0% {
        border-color: var(--orange-light);
        box-shadow: 0 0 5px var(--orange-light);
    }
    100% {
        border-color: var(--orange-dark);
        box-shadow: 0 0 10px var(--orange-dark);
    }
}

/* =============================================
   AJUSTES PARA TELAS MAIORES (Desktop/Tablet)
   =============================================
*/


@media (min-width: 768px) {
    .controls {
        flex-direction: row; /* Volta a alinhar lado a lado em telas maiores */
        justify-content: center;
        align-items: flex-start;
        font-size: 1.5em;
    }
    
    .drop-zone, .options {
        flex: 1;
        max-width: none;
    }

    .drop-zone {
        min-height: 300px;
        border: 6px dashed var(--orange-medium);
    }

    #output-format option{
        font-size: 1.0em;
    }
    .options {
        flex-direction: row; /* Alinha os controles em linha */
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        max-width: none;
        font-size: 1.5em;
    }

    .button-upload {
        font-size: 1.1em;
    }

    .image-frame {
        width: 160px;
        height: 180px;
    }
    .image-frame .size-info {
        font-size: 0.9em;
    }
    .options label,
    .options select,
    .options button {
        width: auto; /* Deixa os elementos terem um tamanho natural */
    }

    h1{
        font-size: 1.1em;
    }

    h5 {
        font-size: 1.5em;
    }

    #arraste{
        font-size: 1.5em;
    }

    #ou{
        font-size: 1.5em;
    }
}