/*
Conversor de Imagens - Estilos
Paleta de cores:
#8ecae6 (Azul claro)
#219ebc (Azul médio)
#023047 (Azul escuro)
#ffb703 (Amarelo)
#fb8500 (Laranja)
*/

/* Reset e estilos base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Roboto", Arial, sans-serif;
    line-height: 1.6;
    color: #023047;
    background-color: #f5f7f8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container principal */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* Cabeçalho */
header {
    background-color: #023047;
    color: white;
    padding: 20px 0;
    text-align: center;
}

header h1 {
    margin: 0;
    padding: 0;
    font-size: 1.8rem;
    color: white;
}

/* Rodapé */
footer {
    background-color: #023047;
    color: white;
    text-align: center;
    padding: 15px 0;
    margin-top: auto;
    font-size: 0.9rem;
}

/* Conteúdo principal */
main {
    flex: 1;
    padding: 30px 0;
}

/* Títulos */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: #023047;
    margin-bottom: 20px;
}

/* Título da página inicial */
.home-title {
    font-size: 1.4rem;
    line-height: 1.4;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Links */
a {
    color: #219ebc;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #fb8500;
}

/* Botões */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #219ebc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s, transform 0.2s;
    text-align: center;
}

.btn:hover {
    background-color: #8ecae6;
    transform: translateY(-2px);
}

.btn-primary {
    background-color: #219ebc;
}

.btn-secondary {
    background-color: #8ecae6;
}

.btn-accent {
    background-color: #fb8500;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.2rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-accent {
    background-color: #fb8500;
}

.btn-accent:hover {
    background-color: #ffb703;
}

/* Cards */
.form-check-style {
    font-size: 1.2rem;
    background-color: #ffcc99;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-left: 10px;
}

.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
    overflow: hidden;
    max-height: fit-content;
}

.card-header {
    background-color: #8ecae6;
    color: #023047;
    padding: 6px 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
}

.card-header h2,
.card-header h3 {
    padding: 0;
    margin: 0;
}

.card-body {
    padding: 12px 15px 15px 15px;
}

.card-footer {
    background-color: #f5f7f8;
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
}

/* Formulários */
.form-group {
    margin-bottom: 12px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #023047;
}

.form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: #219ebc;
    box-shadow: 0 0 0 2px rgba(33, 158, 188, 0.2);
}

.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.form-check-input {
    margin-right: 10px;
}

.form-check-label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: bold;
}

/* Área de upload */
.upload-area {
    border: 2px dashed #8ecae6;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background-color: rgba(142, 202, 230, 0.1);
    transition: background-color 0.3s, border-color 0.3s;
    cursor: pointer;
    margin-bottom: 20px;
}

.upload-area:hover,
.upload-area.dragover {
    background-color: rgba(142, 202, 230, 0.2);
    border-color: #219ebc;
}

.upload-icon {
    font-size: 3rem;
    color: #219ebc;
    margin-bottom: 15px;
}

.upload-text {
    margin-bottom: 15px;
    color: #023047;
}

.upload-input {
    display: none;
}

/* Alertas e mensagens */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Tabelas */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background-color: #8ecae6;
    color: #023047;
    font-weight: bold;
}

.table tr:nth-child(even) {
    background-color: #f5f7f8;
}

.table tr:hover {
    background-color: rgba(142, 202, 230, 0.1);
}

/* Tabela de Resultados */
.table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.results-table th,
.results-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
    vertical-align: top;
}

.results-table th {
    background-color: #a8dadc;
    font-weight: bold;
    text-align: center;
}

.results-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.results-table tr:hover {
    background-color: rgba(142, 202, 230, 0.1);
}

/* Estilos para dispositivos móveis - tabela de resultados */
@media screen and (max-width: 768px) {
    .results-table {
        display: block;
        width: 100%;
    }

    .results-table thead {
        display: none;
    }

    .results-table tbody {
        display: block;
        width: 100%;
    }

    .results-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 5px;
        overflow: hidden;
    }

    .results-table td {
        display: flex;
        flex-direction: column;
        padding: 8px 12px;
        text-align: left;
        border: none;
        border-bottom: 1px solid #eee;
    }

    .results-table td:last-child {
        border-bottom: none;
    }

    .results-table td::before {
        content: attr(data-label);
        font-weight: bold;
        margin-bottom: 4px;
        color: #219ebc;
    }

    .results-table tr:last-child {
        margin-bottom: 0;
    }
}

/* Layout Grid */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Grid para recursos e formatos na página inicial */
.features-section .grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 5px;
    margin-bottom: 20px;
}

/* Em tablets e laptops, os cards ficam em uma coluna */
@media (max-width: 1200px) {
    .features-section .grid {
        grid-template-columns: 1fr;
    }
}

/* Garantir que os cards de formatos tenham a mesma largura */
.features-section,
.card .grid {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Responsividade */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .features-section {
        margin-left: 10px;
        margin-right: 10px;
    }

    .card {
        margin-left: 5px;
        margin-right: 5px;
    }
}

/* Dispositivos muito pequenos */
@media (max-width: 480px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .feature-title-wrapper {
        flex-direction: column;
        text-align: center;
    }

    .feature-icon {
        margin-right: 0;
        margin-bottom: 10px;
        font-size: 1.8rem;
    }

    .home-title {
        font-size: 1.2rem;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .features-section {
        margin-left: 15px;
        margin-right: 15px;
    }

    .card {
        margin-left: 8px;
        margin-right: 8px;
        margin-bottom: 15px;
    }

    .feature-card {
        max-width: 100%;
    }
}

@media (min-width: 993px) and (max-width: 1200px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding-left: 25px;
        padding-right: 25px;
    }

    .features-section {
        margin-left: 20px;
        margin-right: 20px;
    }

    .card {
        margin-left: 10px;
        margin-right: 10px;
        margin-bottom: 15px;
    }

    .feature-card {
        max-width: 100%;
    }
}

@media (min-width: 1201px) {
    .grid {
        grid-template-columns: 1fr 2fr;
    }

    .container {
        padding-left: 30px;
        padding-right: 30px;
    }

    .features-section {
        margin-left: 25px;
        margin-right: 25px;
    }

    .card {
        margin-left: 12px;
        margin-right: 12px;
    }
}

/* Componentes específicos */
.file-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.file-preview img {
    max-width: 180px;
    max-height: 150px;
    border-radius: 4px;
    margin-bottom: 0;
}

.file-info {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    width: 100%;
}

.file-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.file-size {
    color: #888;
    margin-left: 10px;
}

/* Opções de conversão */
.conversion-options {
    margin-top: 10px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 35px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
}

.option-group {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.option-group:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Cores para cada tipo de opção */
.option-format,
.option-resize,
.option-dpi,
.option-compression {
    background-color: rgba(251, 133, 0, 0.08);
    border-left: 4px solid #fb8500;
}

/* Range slider */
.range-slider {
    width: 100%;
}

.range-slider-container {
    display: flex;
    align-items: center;
}

.range-slider-value {
    min-width: 50px;
    text-align: right;
    margin-left: 10px;
}

/* Spinner de carregamento */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(142, 202, 230, 0.3);
    border-radius: 50%;
    border-top-color: #219ebc;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.loading-text {
    margin-top: 15px;
    color: #023047;
}

/* Página inicial */
.feature-card {
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.feature-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.features-title {
    font-size: 1.5rem;
    color: #023047;
    text-align: center;
}

.features-section {
    margin-bottom: 10px;
    margin-top: 30px;
    background-color: #f5f7f8;
    padding-top: 20px;
}

.feature-icon {
    font-size: 1.5rem;
    color: #219ebc;
    margin-right: 10px;
}

.feature-title {
    font-size: 1.2rem;
    color: #023047;
    display: inline-flex;
    align-items: center;
    margin-bottom: 10px;
}

.feature-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.feature-description {
    color: #666;
}

/* Botão de voltar para o topo */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #219ebc;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
    opacity: 1;
}

.back-to-top:hover {
    background-color: #fb8500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background-color: #8ecae6;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    color: #023047;
    margin: 0;
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #023047;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    background-color: #f5f7f8;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Página inicial */
.home-hero {
    text-align: center;
}

.home-subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #666;
}

.home-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

/* Estilos para os cards de resultados */
.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 1.2em;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.result-card-header {
    background-color: #8ecae6;
    color: #023047;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #023047;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.success {
    background-color: #2a9d8f;
    color: white;
}

.status-badge.error {
    background-color: #e63946;
    color: white;
}

.result-card-body {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.file-info,
.conversion-details,
.conversion-stats {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
}

.file-info h4,
.conversion-details h4,
.conversion-stats h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.14rem;
    color: #023047;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}

.info-row {
    display: flex;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: #555;
    margin-right: 5px;
    min-width: 120px;
    font-size: 1.02rem;
}

.info-value {
    flex: 1;
    font-size: 1.02rem;
    color: #333;
}

.download-link {
    color: #219ebc;
    text-decoration: none;
    transition: color 0.2s;
}

.download-link:hover {
    color: #fb8500;
    text-decoration: underline;
}

.stat-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-item i {
    margin-right: 8px;
    font-size: 1rem;
}

.stat-item.success {
    background-color: rgba(42, 157, 143, 0.1);
    color: #2a9d8f;
}

.stat-item.warning {
    background-color: rgba(251, 133, 0, 0.1);
    color: #fb8500;
}

.stat-item.error {
    background-color: rgba(230, 57, 70, 0.1);
    color: #e63946;
}

.stat-item.info {
    background-color: rgba(33, 158, 188, 0.1);
    color: #219ebc;
}

.result-card-footer {
    padding: 15px;
    background-color: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
}

.result-card-footer .btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Lista de erros */
.error-list {
    padding-left: 20px;
    margin-top: 5px;
}

.error-list li {
    margin-bottom: 5px;
}

/* Responsividade */
@media (max-width: 768px) {
    .results-container {
        grid-template-columns: 1fr;
    }

    .info-row {
        flex-direction: column;
    }

    .info-label {
        margin-bottom: 2px;
    }
}