/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    flex: 1;
    padding: 2rem 1rem;
}

/* Seletor de Idioma */
.language-switcher {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.5rem;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.language-switcher button {
    background: white;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    padding: 0.25rem;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.language-switcher button svg {
    display: block;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    width: 32px;
    height: 24px;
}

.language-switcher button.active {
    border-color: var(--color-tertiary);
    background: rgba(255, 215, 0, 0.15);
    transform: scale(1.05);
}

.language-switcher button:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.language-switcher button:active {
    transform: scale(1.02);
}

/* Grid de Botões */
.button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Mantém 2 colunas mesmo em celular */
@media (max-width: 640px) {
    .button-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* Botões Mobile Home e Admin */
.btn-mobile-home,
.btn-mobile-admin {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem 1rem;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    transition: all 0.3s;
    min-height: 140px;
    background: var(--color-tertiary);
    color: var(--color-quaternary);
}

.btn-mobile-home i,
.btn-mobile-admin i {
    font-size: 2rem;
}

.btn-mobile-home:active,
.btn-mobile-admin:active {
    transform: scale(0.95);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.btn-mobile-home:hover,
.btn-mobile-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

/* Botão Voltar */
.btn-voltar {
    background: var(--color-tertiary);
    color: var(--color-quaternary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    margin-bottom: 1rem;
}

.btn-voltar:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Botões Gerais */
.btn-mobile {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.btn-mobile:active {
    transform: scale(0.98);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-mobile:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 10px rgba(0,0,0,0.15);
}

/* Botão Relatório */
.btn-relatorio {
    background: #dc2626;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.btn-relatorio:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Formulários */
.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-tertiary);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.form-container,
.config-form {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
}

/* Logo */
.logo-container {
    max-width: 200px;
    max-height: 200px;
    margin: 3rem auto 2rem;
}

.logo-container img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Rodapé */
footer {
    padding: 1.5rem;
    text-align: center;
    color: white;
    margin-top: auto;
}

.footer-logo {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

/* Tabelas */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

table {
    min-width: 100%;
    font-size: 0.9rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
}

th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

tbody tr {
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: rgba(0,0,0,0.02);
}

/* Galeria de Fotos */
.foto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.foto-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.foto-item:hover {
    transform: scale(1.03);
}

.foto-item img {
    width: 100%;
    height: 225px;
    object-fit: cover;
}

.foto-item button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.foto-item button:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

/* Color Picker */
.color-picker-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.color-preview {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input[type="color"] {
    height: 50px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #e5e7eb;
}

/* Textarea */
textarea {
    resize: vertical;
    min-height: 100px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal-content {
    max-width: 400px;
    width: 100%;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-container > div:not(.hidden) {
    animation: fadeIn 0.3s ease-in-out;
}

/* Scrollbar Customizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--color-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-secondary);
}

/* Focus Visible */
*:focus-visible {
    outline: 2px solid var(--color-tertiary);
    outline-offset: 2px;
}

/* Responsivo */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem 0.75rem;
    }
    
    .btn-mobile-home,
    .btn-mobile-admin {
        padding: 1.5rem 0.75rem;
        min-height: 120px;
    }
    
    .form-input {
        font-size: 16px; /* Evita zoom no iOS */
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    table {
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 0.5rem !important;
    }
}

/* Print */
@media print {
    .btn-mobile, .btn-voltar, button, footer, .language-switcher {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
}

/* Loading */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Transições */
button, a, input[type="file"], .foto-item {
    cursor: pointer;
}

* {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
