/* ===== RESET E BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --color-primary: #8B4513;
    --color-secondary: #DAA520;
    --color-tertiary: #FFD700;
    --color-quaternary: #FFFFFF;
}

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

/* ===== CONTAINER PRINCIPAL ===== */
.app-container {
    flex: 1;
    padding: 1.5rem 1rem 1rem;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

/* ===== SELETOR DE IDIOMA ===== */
.language-switcher {
    position: fixed;
    top: 0.6rem;
    right: 0.6rem;
    display: flex;
    gap: 0.4rem;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.4rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.language-switcher button {
    background: white;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    padding: 0.2rem;
    transition: all 0.25s;
    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: 30px;
    height: 22px;
}

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

.language-switcher button:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0,0,0,0.18);
}

/* ===== LOGO CONTAINER ===== */
.logo-container {
    width: 200px;
    height: 200px;
    margin: 2.5rem auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-container img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* ===== NOME DA EMPRESA ===== */
.empresa-nome {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-tertiary);
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
}

/* ===== GRID DE BOTÕES ===== */
.button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

@media (max-width: 400px) {
    .button-grid {
        gap: 0.75rem;
    }
}

/* ===== BOTÕES HOME E ADMIN ===== */
.btn-mobile-home,
.btn-mobile-admin {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1.75rem 1rem;
    border-radius: 18px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    transition: all 0.25s;
    min-height: 130px;
    background: var(--color-tertiary);
    color: var(--color-quaternary);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.btn-mobile-home::before,
.btn-mobile-admin::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: rgba(255,255,255,0.12);
    border-radius: 18px 18px 0 0;
}

.btn-mobile-home i,
.btn-mobile-admin i {
    font-size: 1.8rem;
    position: relative;
}

.btn-mobile-home div,
.btn-mobile-admin div {
    position: relative;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
}

.btn-mobile-home:active,
.btn-mobile-admin:active {
    transform: scale(0.94);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.btn-mobile-home:hover,
.btn-mobile-admin:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.25);
}

/* ===== BOTÃO VOLTAR ===== */
.btn-voltar {
    background: var(--color-tertiary);
    color: var(--color-quaternary);
    padding: 0.7rem 1.4rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    transition: all 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.btn-voltar:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.2);
}

/* ===== BOTÕES GERAIS ===== */
.btn-mobile {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
    transition: all 0.25s;
}

.btn-mobile:active {
    transform: scale(0.97);
}

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

/* ===== BOTÃO RELATÓRIO ===== */
.btn-relatorio {
    background: #dc2626;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.25s;
}

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

/* ===== BOTÕES CRUD ===== */
.btn-novo {
    background: #16a34a;
    color: white;
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.25s;
    margin-bottom: 0.5rem;
}

.btn-novo:hover {
    background: #15803d;
    transform: translateY(-1px);
}

.btn-alterar {
    background: var(--color-tertiary);
    color: var(--color-quaternary);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 0.3rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s;
}

.btn-alterar:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.btn-excluir {
    background: #dc2626;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s;
}

.btn-excluir:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.btn-gravar {
    background: #16a34a;
    color: white;
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.25s;
}

.btn-gravar:hover {
    background: #15803d;
    transform: translateY(-1px);
}

/* ===== FORMULÁRIOS ===== */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    font-size: 1rem;
    background: rgba(255,255,255,0.95);
    color: #1f2937;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.form-container,
.config-form,
.config-container {
    background: rgba(255, 255, 255, 0.07);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* ===== TELA ADMIN LOGIN ===== */
.login-card {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 2rem;
    max-width: 400px;
    margin: 2rem auto;
    backdrop-filter: blur(10px);
}

/* ===== RODAPÉ ===== */
#app-footer {
    background: var(--color-secondary);
    padding: 1rem 1.5rem;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 700px;
    margin: 0 auto;
}

.footer-logo-wrap {
    flex-shrink: 0;
}

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

.footer-text {
    flex: 1;
    text-align: center;
}

.footer-company {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-primary);
}

.footer-phone {
    font-size: 0.8rem;
    color: var(--color-primary);
    opacity: 0.85;
}

/* ===== TABELAS ===== */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: white;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

table {
    min-width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
}

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

th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

tbody tr {
    border-top: 1px solid #f3f4f6;
    transition: background-color 0.15s;
}

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

/* ===== 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 10px rgba(0,0,0,0.15);
    transition: transform 0.25s;
    aspect-ratio: 2/3;
}

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

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

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

.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: 10px;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

input[type="color"] {
    height: 50px;
    width: 90px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 2px;
    background: white;
}

/* ===== TEXTAREA ===== */
textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

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

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.88) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

/* ===== ANIMAÇÕES ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

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

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

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

/* ===== TÍTULOS ===== */
h2.screen-title {
    color: white;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ===== CARDS DE INFO ===== */
.info-card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 14px;
    padding: 1.25rem;
}

/* ===== BADGE ===== */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-green {
    background: #dcfce7;
    color: #166534;
}

.badge-red {
    background: #fee2e2;
    color: #991b1b;
}

/* ===== SEÇÃO VISIBILIDADE ===== */
.visibility-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 480px) {
    .app-container {
        padding: 1rem 0.75rem;
    }

    .btn-mobile-home,
    .btn-mobile-admin {
        padding: 1.4rem 0.75rem;
        min-height: 118px;
        border-radius: 14px;
    }

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

    .btn-mobile-home div,
    .btn-mobile-admin div {
        font-size: 0.82rem;
    }

    .form-input {
        font-size: 16px;
    }

    h2.screen-title {
        font-size: 1.35rem;
    }

    table {
        font-size: 0.78rem;
    }

    th, td {
        padding: 0.5rem 0.6rem !important;
    }

    .logo-container {
        width: 160px;
        height: 160px;
        margin: 2rem auto 1.25rem;
    }

    .logo-container img {
        width: 160px;
        height: 160px;
    }

    .empresa-nome {
        font-size: 1.35rem;
    }
}

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

/* ===== LOADING ===== */
.loading {
    opacity: 0.55;
    pointer-events: none;
}

/* ===== WHATSAPP BUTTON ===== */
.btn-whatsapp {
    background: #25D366;
    color: white;
    font-weight: 700;
}

.btn-whatsapp:hover {
    background: #1ebe5d;
}

/* ===== ADMIN BADGE ===== */
.admin-user-badge {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 0.3rem 0.75rem;
    font-size: 0.82rem;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
