@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-image: url("../img/Back (1).png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-color: #0a0e27;
    min-height: 100vh;
    padding-bottom: 80px;
}

.header-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(20, 99, 139, 0.95) 0%, rgba(17, 80, 111, 0.9) 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-nav .logo {
    width: 50px;
    height: 50px;
}

.header-nav h1 {
    font-size: 1.5rem;
    color: white;
    font-weight: 700;
}

.container {
    max-width: 600px;
    margin: 2rem auto 0;
    padding: 0 15px;
}

.card-wrapper {
    background: transparent;
    backdrop-filter: none;
    border-radius: 24px;
    overflow: visible;
    box-shadow: none;
    border: none;
}

.header {
    background: transparent;
    padding: 2rem 2rem 1rem 2rem;
    text-align: center;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.logo-container img {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.btn-voltar {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(20, 99, 139, 0.5);
    color: white;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    z-index: 1000;
}

.btn-voltar:hover {
    border-color: #14638b;
    background: rgba(20, 99, 139, 0.3);
    transform: translateY(-2px);
}

.agendamento-form {
    padding: 1.5rem 2rem 2rem 2rem;
}

/* Campos do formulário */
.campo-selecao {
    margin-bottom: 20px;
}

.campo-btn {
    width: 100%;
    padding: 24px 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(20, 99, 139, 0.5);
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    font-family: 'Poppins', sans-serif;
}

.campo-btn:hover {
    border-color: #14638b;
    background: rgba(20, 99, 139, 0.15);
    transform: translateY(-2px);
}

.campo-btn.preenchido {
    border-color: #14638b;
    background: rgba(20, 99, 139, 0.2);
    color: #ffffff;
}

.campo-label {
    display: flex;
    align-items: center;
    gap: 12px;
}

.campo-icone {
    font-size: 1.4em;
}

.campo-texto {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.campo-titulo {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.campo-valor {
    font-size: 1.05em;
    color: #ffffff;
    font-weight: 600;
}

.campo-seta {
    font-size: 1.3em;
    color: rgba(255, 255, 255, 0.5);
}

/* Popup Overlay */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 2000;
    align-items: flex-end;
}

.popup-overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Popup Content */
.popup-content {
    width: 100%;
    max-height: 85vh;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.98) 0%, rgba(13, 73, 99, 0.98) 100%);
    border-radius: 24px 24px 0 0;
    overflow-y: auto;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(20, 99, 139, 0.5);
    border-bottom: none;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.popup-overlay.show .popup-content {
    transform: translateY(0);
}

.popup-handle {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.popup-handle-bar {
    width: 50px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem 1.5rem 2rem;
    border-bottom: 2px solid rgba(20, 99, 139, 0.3);
}

.popup-header h3 {
    color: #ffffff;
    font-size: 1.6em;
    font-weight: 700;
}

.close-popup {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-popup:hover {
    background: rgba(220, 53, 69, 0.8);
    border-color: #dc3545;
    transform: rotate(90deg);
}

.popup-body {
    padding: 2rem;
}

/* Barbeiros Grid */
.barbeiros-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.barbeiro-card {
    background: rgba(255, 255, 255, 0.05);
    border: 3px solid rgba(20, 99, 139, 0.3);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.barbeiro-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(20, 99, 139, 0.4);
    border-color: #14638b;
}

.barbeiro-card.selected {
    border-color: #14638b;
    background: linear-gradient(135deg, rgba(20, 99, 139, 0.3) 0%, rgba(13, 73, 99, 0.3) 100%);
    box-shadow: 0 8px 20px rgba(20, 99, 139, 0.5);
}

.barbeiro-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 12px;
    overflow: hidden;
    border: 4px solid #14638b;
}

.barbeiro-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.barbeiro-name {
    font-size: 1.2em;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
}

.barbeiro-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85em;
    line-height: 1.4;
}

/* Serviços */
.servicos-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.servico-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(20, 99, 139, 0.3);
    border-radius: 14px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.servico-item:hover {
    border-color: #14638b;
    background: rgba(20, 99, 139, 0.15);
    transform: translateX(6px);
}

.servico-item.selected {
    border-color: #14638b;
    background: linear-gradient(135deg, rgba(20, 99, 139, 0.3) 0%, rgba(13, 73, 99, 0.3) 100%);
    box-shadow: 0 4px 12px rgba(20, 99, 139, 0.4);
}

.servico-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.servico-icone {
    font-size: 1.6em;
}

.servico-detalhes {
    display: flex;
    flex-direction: column;
}

.servico-nome {
    font-size: 1.05em;
    font-weight: 600;
    color: #ffffff;
}

.servico-preco {
    font-size: 1.1em;
    font-weight: 700;
    color: #14638b;
}

/* Calendário */
.calendario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(20, 99, 139, 0.3);
}

.calendario-header h4 {
    color: #ffffff;
    font-size: 1.3em;
    font-weight: 600;
}

.calendario-nav {
    display: flex;
    gap: 10px;
}

.calendario-nav button {
    background: rgba(20, 99, 139, 0.3);
    border: 1px solid rgba(20, 99, 139, 0.5);
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.3em;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.calendario-nav button:hover {
    background: #14638b;
    transform: scale(1.1);
}

.calendario-dias-semana {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.dia-semana {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
    font-weight: 600;
    padding: 10px 0;
}

.calendario-dias {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.dia {
    padding: 14px 8px;
    text-align: center;
    border-radius: 12px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.dia:hover {
    background: rgba(20, 99, 139, 0.3);
    border-color: #14638b;
}

.dia.disabled {
    color: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
}

.dia.disabled:hover {
    background: transparent;
    border-color: transparent;
}

.dia.selected {
    background: linear-gradient(135deg, #14638b 0%, #0d4963 100%);
    border-color: #14638b;
    box-shadow: 0 4px 12px rgba(20, 99, 139, 0.5);
}

.dia.today {
    border-color: #ffc107;
}

/* Horários */
.horarios-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.horario-item {
    padding: 16px 12px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(20, 99, 139, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1em;
}

.horario-item:hover {
    background: rgba(20, 99, 139, 0.2);
    border-color: #14638b;
    transform: translateY(-3px);
}

.horario-item.selected {
    background: linear-gradient(135deg, #14638b 0%, #0d4963 100%);
    border-color: #14638b;
    color: white;
    box-shadow: 0 6px 16px rgba(20, 99, 139, 0.5);
}

.horario-item.ocupado {
    background: rgba(200, 0, 0, 0.15);
    border-color: rgba(255, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    opacity: 0.6;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    position: relative;
}

.horario-item.ocupado::after {
    content: '\2716';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 0, 0, 0.6);
    font-size: 14px;
}

.horario-item.ocupado:hover {
    background: rgba(200, 0, 0, 0.15);
    border-color: rgba(255, 0, 0, 0.3);
    transform: none;
}

/* Botão Submit */
.submit-btn {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #14638b 0%, #0d4963 100%);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 1.15em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
    font-family: 'Poppins', sans-serif;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(20, 99, 139, 0.5);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Animação de shake para horários ocupados */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Loading no botão */
.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spinner {
    animation: rotate 1s linear infinite;
}

.spinner .path {
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.error-message {
    background: rgba(220, 53, 69, 0.15);
    border: 2px solid #dc3545;
    color: #ff6b6b;
    padding: 16px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: none;
    font-weight: 600;
    align-items: center;
    gap: 10px;
}

.error-message.show {
    display: flex;
}

/* Loading de horários */
.loading-horarios {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
}

.loading-horarios p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95em;
    font-weight: 500;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(20, 99, 139, 0.2);
    border-top: 4px solid #14638b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.horarios-grid {
    transition: opacity 0.3s ease;
}

/* Modal de Sucesso */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.98) 0%, rgba(13, 73, 99, 0.98) 100%);
    border: 2px solid rgba(20, 99, 139, 0.5);
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

.modal-icon {
    font-size: 4em;
    margin-bottom: 1rem;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.modal-content h2 {
    color: #ffffff;
    font-size: 1.8em;
    margin-bottom: 1rem;
}

.modal-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1em;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.btn-modal {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #14638b 0%, #0d4963 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 12px;
    font-family: 'Poppins', sans-serif;
}

.btn-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(20, 99, 139, 0.5);
}

.btn-modal-secondary {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: white;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.btn-modal-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    body {
        background-attachment: fixed;
        background-size: cover;
        background-position: center;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: url("../img/Back (1).png");
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        z-index: -999;
    }
    
    .btn-voltar {
        top: 10px;
        left: 10px;
        padding: 6px 12px;
        font-size: 0.8rem;
        border-radius: 8px;
        gap: 4px;
    }

    .container {
        max-width: 100%;
    }

    .barbeiros-grid {
        grid-template-columns: 1fr;
    }

    .horarios-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Barra de Navegação Inferior */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(20, 99, 139, 0.95) 0%, rgba(17, 80, 111, 0.95) 100%);
    backdrop-filter: blur(10px);
    padding: 0.75rem 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 0.5rem;
    min-width: 70px;
}

.nav-item svg {
    stroke: currentColor;
    width: 24px;
    height: 24px;
}

.nav-item.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}
