/* =============================================================================
   AGENDA DE CONTATOS - ESTILOS COMPLETOS
   ============================================================================= */

/* Container principal da agenda */
.agenda-section {

    min-height: calc(100vh - 100px);
}


.section-header h2 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2::before {
    content: "📅";
    font-size: 24px;
}

/* Container da agenda */
.agenda-container {
    background: white;
    border-radius: 12px;
    margin: 5px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* Header do calendário */
.calendar-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.calendar-header .btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.calendar-header .btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

/* Grid da agenda */
.agenda-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 600px;
}

/* Sidebar da agenda */
.agenda-sidebar {
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    padding: 25px 20px;
    overflow-y: auto;
    max-height: 600px;
}

.agenda-sidebar h4 {
    color: #495057;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agenda-sidebar h4::before {
    content: "⏰";
    font-size: 16px;
}

/* Lista de agendamentos */
.agenda-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agenda-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.agenda-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #17a2b8;
    transition: all 0.3s ease;
}

.agenda-item:hover {
    border-color: #17a2b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23,162,184,0.15);
}

.agenda-item:hover::before {
    width: 6px;
    background: #0056b3;
}

.agenda-item.urgent::before {
    background: #dc3545;
}

.agenda-item.completed {
    opacity: 0.7;
    background: #f8f9fa;
}

.agenda-item.completed::before {
    background: #28a745;
}

.agenda-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.agenda-item-time {
    font-size: 14px;
    font-weight: 600;
    color: #17a2b8;
    background: rgba(23,162,184,0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.agenda-item.urgent .agenda-item-time {
    color: #dc3545;
    background: rgba(220,53,69,0.1);
}

/* BOTÕES DE AÇÃO DA AGENDA - Estilo igual ao funil de vendas */
.agenda-item-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: all 0.3s ease;
    align-items: center;
}

.agenda-item:hover .agenda-item-actions {
    opacity: 1;
}

.btn-agenda-action {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: white;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.btn-agenda-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transition: left 0.3s ease;
}

.btn-agenda-action:hover::before {
    left: 100%;
}

.btn-agenda-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Cores específicas para cada tipo de ação */
/* Telefone - Verde */
.btn-agenda-action[title*="Ligar"]:hover {
    background: #28a745;
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* WhatsApp - Verde WhatsApp */
.btn-agenda-action[title*="WhatsApp"]:hover {
    background: #25d366;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* Email - Azul */
.btn-agenda-action[title*="E-mail"]:hover {
    background: #007bff;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Editar - Amarelo */
.btn-agenda-action[title*="Editar"]:hover {
    background: #ffc107;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

/* Excluir - Vermelho */
.btn-agenda-action[title*="Excluir"]:hover {
    background: #dc3545;
    color: white;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Visualização do calendário */
.calendar-view {
    padding: 25px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 1px;
    background: #e9ecef;
    border-radius: 6px 6px 0 0;
    overflow: hidden;
}

.calendar-weekdays > div {
    background: #495057;
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
}

.calendar-day {
    background: white;
    min-height: 80px;
    padding: 8px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.calendar-day:hover {
    background: #f8f9fa;
    border-color: #17a2b8;
}

.calendar-day.other-month {
    background: #f8f9fa;
    color: #adb5bd;
}

.calendar-day.today {
    background: #e3f2fd;
    border-color: #2196f3;
    font-weight: 600;
}

.calendar-day.selected {
    background: #17a2b8;
    color: white;
}

.calendar-day-number {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.calendar-day.today .calendar-day-number {
    color: #2196f3;
    font-weight: 700;
}

.calendar-day.selected .calendar-day-number {
    color: white;
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-event {
    background: #17a2b8;
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-event:hover {
    background: #138496;
    transform: scale(1.02);
}

.calendar-event.urgent {
    background: #dc3545;
}

.calendar-event.completed {
    background: #28a745;
}

/* Modal de agendamento */
.modal-agenda {
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal-agenda .modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-agenda .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 20px 25px;
}

.modal-agenda .modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-agenda .close {
    color: white;
    opacity: 0.8;
    font-size: 28px;
}

.modal-agenda .close:hover {
    opacity: 1;
}

/* Formulário de agendamento */
.form-agenda {
    padding: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #17a2b8;
    box-shadow: 0 0 0 3px rgba(23,162,184,0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Botões do formulário */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    margin-top: 25px;
}

.btn-agenda {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-agenda-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-agenda-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

.btn-agenda-secondary {
    background: #6c757d;
    color: white;
}

.btn-agenda-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Estados de loading */
.loading-agenda {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #6c757d;
}

.loading-agenda .fas {
    font-size: 24px;
    margin-bottom: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsividade */
@media (max-width: 1024px) {
    .agenda-grid {
        grid-template-columns: 280px 1fr;
    }
    
    .calendar-day {
        min-height: 70px;
        padding: 6px;
    }
}

@media (max-width: 768px) {
    .agenda-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        gap: 0;
    }
    
    .agenda-sidebar {
        max-height: none;
        border-right: none;
        border-bottom: 2px solid #e9ecef;
        padding: 15px;
    }
    
    .calendar-container {
        padding: 15px;
    }
    
    .calendar-header {
        padding: 12px;
        gap: 10px;
    }
    
    .calendar-header h3 {
        font-size: 18px;
    }
    
    .calendar-nav button {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .calendar-weekdays > div {
        padding: 10px 4px;
        font-size: 11px;
        font-weight: 600;
    }
    
    .calendar-days {
        gap: 3px;
    }
    
    .calendar-day {
        min-height: 65px;
        padding: 6px;
    }
    
    .calendar-day-number {
        font-size: 13px;
    }
    
    .calendar-event {
        font-size: 10px;
        padding: 2px 4px;
        margin-top: 2px;
    }
    
    .agenda-item {
        padding: 15px;
        margin-bottom: 12px;
    }
    
    .agenda-item-header h4 {
        font-size: 15px;
    }
    
    .agenda-item-time {
        font-size: 13px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .section-header .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .agenda-section {
        padding: 15px;
    }
    
    .section-header h2 {
        font-size: 20px;
    }
    
    .section-header h2::before {
        font-size: 18px;
    }
    
    .calendar-header {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .calendar-header h3 {
        font-size: 18px;
    }
    
    .calendar-weekdays > div {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .calendar-day {
        min-height: 50px;
        padding: 3px;
    }
    
    .calendar-day-number {
        font-size: 12px;
    }
    
    .agenda-item {
        padding: 12px;
    }
}

/* Animações */
.agenda-item {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-day {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tooltip para eventos */
.calendar-event[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

/* Estados especiais */

#addAgendamentoForm{
    margin: 0px 15px;

}

.agenda-item.priority-high {
    border-left-color: #dc3545;
    border-left-width: 4px;
}

.agenda-item.priority-medium {
    border-left-color: #ffc107;
    border-left-width: 4px;
}

.agenda-item.priority-low {
    border-left-color: #28a745;
    border-left-width: 4px;
}

/* Filtros da agenda */
.agenda-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.agenda-filters:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.filter-agenda {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.filter-agenda label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.filter-agenda select,
.filter-agenda input {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
    min-width: 0;
}

.filter-agenda select:focus,
.filter-agenda input:focus {
    outline: none;
    border-color: #17a2b8;
    box-shadow: 0 0 0 3px rgba(23,162,184,0.1);
    transform: translateY(-1px);
}

.filter-agenda select:hover,
.filter-agenda input:hover {
    border-color: #17a2b8;
    background: #fafbfc;
}

/* Badge de status */
.status-badge-agenda {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge-agenda.pendente {
    background: #ffc107;
    color: #212529;
}

.status-badge-agenda.concluido {
    background: #28a745;
    color: white;
}

.status-badge-agenda.cancelado {
    background: #dc3545;
    color: white;
}