/* Estilos globais */
:root {
    --primary-color: #9c27b0;
    --primary-light: #ba68c8;
    --secondary-color: #2ecc71;
    --text-color: #333;
    --bg-color: #f5f7fa;
    --card-bg: #fff;
    --border-color: #e0e0e0;
    --success-color: #27ae60;
    --accent-color: #ba68c8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    font-size: 16px;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 100%;
    margin: 0 auto;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    width: 24px;
    height: 3px;
    background-color: var(--primary-color);
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 3px;
    background-color: var(--primary-color);
    left: 0;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

/* Botões */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-light);
}

/* Navegação inferior */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: white;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem 0;
    z-index: 10;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #777;
    font-size: 0.8rem;
    padding: 0.5rem;
    width: 20%;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

/* Contentor principal */
.main-content {
    flex: 1;
    padding: 1rem;
    margin-bottom: 70px; /* Espaço para o bottom-nav */
}

/* Estilos do banner de instalação */
.install-banner {
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 1rem;
}

.install-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.install-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
}

.dismiss-btn {
    background-color: transparent;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
}

/* Utilitários gerais */
.hidden {
    display: none !important;
}

/* Ajuste da tela de loading */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(142, 68, 173, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Botão de voltar */
.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
    margin-right: 1rem;
}

/* Estados de card */
.card-disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Melhorias de acessibilidade */
:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

/* Ajustes responsivos */
@media (max-width: 480px) {
    .install-message {
        flex-direction: column;
        align-items: stretch;
    }
    
    .install-message span {
        margin-bottom: 0.5rem;
    }
}

/* Estilos para tema escuro (opcional) - Desativado por enquanto */
/*
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #f0f0f0;
        --card-bg: #2a2a2a;
        --border-color: #333;
    }
    
    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .app-header {
        background-color: #111;
    }
    
    .bottom-nav {
        background-color: #111;
    }
    
    .service-card, .detalhe-servico {
        background-color: var(--card-bg);
    }
    
    .btn-secondary {
        background-color: #333;
        color: #eee;
    }
}
*/

/* Cores de fundo para as abas de serviços */
.tab-pendente {
    background-color: #f0f0f0; /* Cinza para pendente */
}

.tab-tecelando {
    background-color: #ffeeba; /* Amarelo para tecelando */
}

.tab-concluido {
    background-color: #c3e6cb; /* Verde para concluído */
}

.tab-enviado {
    background-color: #bee5eb; /* Azul claro para enviado */
}

/* Estilo para aba ativa - sobrepõe as cores acima quando ativa */
.tab-btn.active {
    color: #fff;
    font-weight: bold;
}

.tab-pendente.active {
    background-color: #6c757d; /* Cinza escuro */
}

.tab-tecelando.active {
    background-color: #ffc107; /* Amarelo mais forte */
}

.tab-concluido.active {
    background-color: #28a745; /* Verde mais forte */
}

.tab-enviado.active {
    background-color: #17a2b8; /* Azul mais forte */
}

/* Estilos para busca inteligente */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    border: 1px solid #e0e0e0;
    display: none;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-result-item:hover {
    background-color: #f9f9f9;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-details {
    flex-grow: 1;
    margin: 0 10px;
}

.search-result-name {
    font-weight: 600;
    color: #333;
}

.search-result-meta {
    font-size: 0.85rem;
    color: #666;
    margin-top: 3px;
}

.search-result-id {
    color: #888;
    font-weight: 600;
    min-width: 50px;
}

.search-result-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    text-align: center;
    white-space: nowrap;
}

.status-pendente {
    background-color: #f0f0f0;
    color: #555;
}

.status-em_andamento {
    background-color: #ffeeba;
    color: #856404;
}

.status-concluido {
    background-color: #c3e6cb;
    color: #155724;
}

.status-enviado_passadeira {
    background-color: #bee5eb;
    color: #0c5460;
}