/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121212;
    color: #f5f5f5;
    overflow-x: hidden;
}

/* Menu Lateral */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background-color: #1e1e1e;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #333;
}

.sidebar-logo {
    height: 50px;
    width: auto;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #f5f5f5;
    font-size: 20px;
    cursor: pointer;
    display: none;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #f5f5f5;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background-color: #2c2c2c;
    border-left-color: #007bff;
    color: #007bff;
}

.nav-link.active {
    background-color: #007bff;
    color: white;
    border-left-color: #0056b3;
}

.nav-link i {
    margin-right: 12px;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* Overlay para mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

/* Conteúdo Principal */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* Header Principal */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background-color: #1e1e1e;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    background: none;
    border: none;
    color: #f5f5f5;
    font-size: 24px;
    cursor: pointer;
    display: none;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #f5f5f5;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background-color: #2c2c2c;
    border-radius: 25px;
}

.user-info i {
    font-size: 20px;
    color: #007bff;
}

/* Conteúdo da Página */
.page-content {
    padding: 30px;
}

/* Seção de Dados */
.data-section {
    margin-bottom: 30px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.dados {
    margin-bottom: 30px;
}

#formAgendamentos h2 {
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 30px;
    color: #f5f5f5;
}

.msg {
    margin-bottom: 30px;
}

.msg h3 {
    font-size: 20px;
    font-weight: 600;
    color: #f5f5f5;
    margin-bottom: 20px;
}

/* Grid de Agendamentos */
#resultado {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

/* Cards de Agendamento */
.card {
    background-color: #1e1e1e;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #333;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.card-logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: #f5f5f5;
    margin: 0;
}

.card p {
    margin: 12px 0;
    color: #ccc;
    line-height: 1.5;
}

.card strong {
    color: #007bff;
    font-weight: 600;
}

/* Botão WhatsApp */
.whatsapp-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: #25d366;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.whatsapp-button:hover {
    background-color: #128c7e;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.whatsapp-button img {
    width: 28px;
    height: 28px;
}

/* Mensagens de Status */
#resultado p {
    text-align: center;
    font-size: 16px;
    color: #f5f5f5;
    margin: 20px 0;
    grid-column: 1 / -1;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #f5f5f5;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #007bff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.botoes-agendamento {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}
.btn-cancelar {
    background: #e53935;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    flex: 1 1 70%;
    min-width: 0;
}
.btn-cancelar:hover {
    background: #b71c1c;
}
.btn-whatsapp {
    background: #25d366;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    transition: background 0.2s, transform 0.2s;
    flex: 0 0 auto;
}
.btn-whatsapp:disabled {
    background: #888;
    cursor: not-allowed;
}
.btn-whatsapp:hover:not(:disabled) {
    background: #128c7e;
    transform: scale(1.1);
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.9);
    z-index: 999999 !important;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.loading-spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #007bff;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
    margin-bottom: 18px;
}

/* Responsividade */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .page-content {
        padding: 20px 15px;
    }
    
    .main-header {
        padding: 15px 20px;
    }
    
    .page-title {
        font-size: 20px;
    }
    
    #resultado {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 20px;
    }
    
    .card-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .whatsapp-button {
        position: static;
        margin-top: 15px;
        align-self: center;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 15px 10px;
    }
    
    .main-header {
        padding: 10px 15px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    #formAgendamentos h2 {
        font-size: 24px;
    }
    
    .card {
        padding: 15px;
    }
}

/* Tela de Carregamento */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #007bff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

#loading-text {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin: 0;
}

/* Animação de fade para a tela de carregamento */
#loading-screen.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

#loading-screen.fade-out {
    animation: fadeOut 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Responsividade para a tela de carregamento */
@media (max-width: 768px) {
    .spinner {
        width: 40px;
        height: 40px;
        border-width: 6px;
    }
    
    #loading-text {
        font-size: 16px;
    }
}
