/* Container principal responsivo */
.courses-container {
    display: flex;
    justify-content: center;
    margin: 0 auto;
    border: none;
    max-width: 100%;
}

.course {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    width: 100rem;
    overflow: hidden;
    flex-direction: column;
}

.course h6 {
    opacity: 0.6;
    margin: 0;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 1rem;
    font-weight: 600;
}

.course h2 {
    letter-spacing: 1px;
    margin: 0.2% 0.1% 0.4% 0;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 800;
}

.course-preview {
    background-color: #c21c22;
    color: #fff;
    width: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.course-preview a {
    color: #fff;
    display: inline-block;
    font-size: 0.885rem;
    opacity: 0.7;
    margin-top: 1rem;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.course-preview a:hover {
    opacity: 1;
}

.course-info {
    padding: 1.5rem;
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.course-info h6 {
    color: #494949;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    margin-right: 0;
}

.course-info h2 {
    color: #333;
    font-size: clamp(1rem, 3vw, 1.25rem);
    margin: 1rem 0;
}

.course-info .btn {
    background-color: #0d6efd;
    border-radius: 8rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: #fff;
    font-size: clamp(0.7rem, 2vw, 0.8rem);
    padding: 0.75rem 1.5rem;
    margin: 1rem 0;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 13rem;
}

.course-info-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-left: 0;
    margin-top: auto;
    justify-content: center;
}

.course-info-buttons .btn {
    flex: 1;
    min-width: 120px;
    margin: 0;
}

.course-info .btn:hover {
    background-color: #008a4b;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

/* Grid de farmácias responsivo */
.ag-format-container {
    width: 100%;
    margin: 0 auto;
    padding: 1rem;
}

.ag-courses_box {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0;
    justify-content: center;
}

.ag-courses_item {
    flex: 1 1 calc(33.333% - 1rem);
    min-width: 300px;
    max-width: 100%;
    margin: 0 0 1rem 0;
    overflow: hidden;
    border-radius: 1.75rem;
}

.ag-courses-item_link {
    display: block;
    padding: 1.5rem 1.25rem;
    background-color: #3f3f3f;
    overflow: hidden;
    position: relative;
    height: 100%;
    color: #FFF;
    text-decoration: none;
    transition: all 0.3s ease;
}

.ag-courses-item_link:hover {
    text-decoration: none;
    color: #FFF;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.ag-courses-item_link:hover .ag-courses-item_date {
    color: #FFF;
}

.ag-courses-item_link:hover .ag-courses-item_bg {
    transform: scale(10);
}

.ag-courses-item_title {
    min-height: auto;
    margin: 0 0 1rem;
    overflow: hidden;
    font-weight: bold;
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    color: #FFF;
    z-index: 2;
    position: relative;
    line-height: 1.3;
}

.ag-courses-item_content {
    z-index: 2;
    position: relative;
}

.ag-courses-item_info {
    margin-bottom: 1rem;
}

.ag-courses-item_info p {
    margin-bottom: 0.5rem;
    font-size: clamp(0.8rem, 2vw, 0.875rem);
    opacity: 0.9;
    line-height: 1.4;
}

.ag-courses-item_date-box {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    color: #FFF;
    margin-bottom: 0.75rem;
}

.ag-courses-item_date {
    font-weight: bold;
    color: #f9b234;
    transition: color .5s ease;
}

.ag-courses-item_bg {
    height: 8rem;
    width: 8rem;
    background-color: #c21c22;
    z-index: 1;
    position: absolute;
    top: -4.7rem;
    right: -4.7rem;
    border-radius: 50%;
    transition: all .5s ease;
}

.ag-courses-item_actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ag-courses-item_actions .btn {
    border-radius: 1.25rem;
    font-size: clamp(0.7rem, 2vw, 0.75rem);
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 80px;
}

.ag-courses-item_actions .btn:hover {
    transform: scale(1.05);
}

/* Farmácia EM PLANTÃO - VERDE */
.current-pharmacy-bg .ag-courses-item_bg {
    background-color: #198754 !important;
}

/* Farmácia NÃO está em plantão - VERMELHO (já é o padrão) */
.ag-courses-item:not(.current-pharmacy-bg) .ag-courses-item_bg {
    background-color: #c21c22;
}

.btn-type-access2 {
    background-color: var(--primary);
    color: white;
    border: none;
    transition: background-color 0.3s ease;
}

.btn-type-access2:hover {
    background-color: var(--secondary);
    color: white;
}

.section-title2 {
    position: relative;
    padding-bottom: 2%;
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-weight: 700;
}

.current-badge {
    border: 1px solid #198754;
    background-color: #198754;
    color: #ffffff;
    padding: 0.25rem 0.75rem;
    font-size: clamp(0.6rem, 1.5vw, 0.7rem);
    margin-left: 0.5rem;
    margin-top: 0rem;
    border-radius: 0.625rem;
    display: inline-block;
    vertical-align: top;
}
.current-pharmacy-bg .ag-courses-item_link:hover .current-badge {
    border-color: #c21c22;
    background-color: #c21c22;
}

.current-pharmacy-bg .course-info-buttons .btn,
.current-pharmacy-bg .ag-courses-item_actions .btn {
    background-color: #198754 !important;
    border-color: #198754 !important;
}

.current-pharmacy-bg .ag-courses-item_link:hover .btn-outline-light {
    background-color: #c21c22 !important;
    border-color: #c21c22 !important;
    transform: translateY(-2px);
}

/* Layout responsivo para o header */
.main-container .row.align-items-center {
    flex-wrap: wrap;
    gap: 1rem;
}

/* Estilo para botão do WhatsApp */
.btn-whatsapp {
    background-color: #25D366 !important;
    border-color: #25D366 !important;
    color: white !important;
}

.btn-whatsapp:hover {
    background-color: #123d8c !important;
    border-color: #123d8c !important;
    color: white !important;
}

/* Estilo para ícone do WhatsApp */
.text-whatsapp {
    color: #25D366;
}

/* Garante que o ícone fique branco no hover/focus */
.ag-courses-item_link:hover .text-success,
.ag-courses-item_link:focus .text-success,
.ag-courses-item_link:active .text-success {
    color: white !important;
}

/* Notificações */
.alert.position-fixed {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: none;
    border-radius: 8px;
}

/* Botão WhatsApp */
.btn-whatsapp {
    background-color: #25D366 !important;
    color: white !important;
    border: none;
}

.btn-whatsapp:hover {
    background-color: #128C7E !important;
    color: white !important;
}

/* Feedback visual para cópia */
.btn-success {
    background-color: #198754 !important;
    border-color: #198754 !important;
}

/* Ajustes específicos para mobile */
@media (max-width: 768px) {
    .section-title2 {
        padding-bottom: 10px;
        font-weight: 700;
        font-size: 1.5rem;
    }

    .section-title2:after {
        content: '';
        display: none;
    }

    .btn-type-access2{
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    .btn-type-access2{
        font-size: 0.85rem;
        padding: 6px 20px;
        margin-bottom: 8%;
    }

    .courses-container {
        padding: 0 0.5rem;
    }
    
    .course {
        flex-direction: column;
    }
    
    .course-preview {
        width: 100%;
        padding: 1rem;
    }
    
    .course-info {
        padding: 1rem;
    }
    
    .course-info-buttons {
        flex-direction: column !important;
        gap: 0.75rem;
        width: 100%;
    }
    
    .course-info-buttons .btn {
        width: 100% !important;
        min-width: 100% !important;
        margin: 0 !important;
    }
    
    .ag-courses_item {
        flex: 1 1 100%;
        min-width: auto;
        margin: 0 0 1rem 0;
    }
    
    .ag-courses-item_link {
        padding: 1.25rem 1rem;
    }
    
    .ag-courses-item_actions {
        flex-direction: column;
    }
    
    .ag-courses-item_actions .btn {
        width: 100%;
        min-width: auto;
    }
    
    /* Ajuste do círculo de fundo para mobile */
    .ag-courses-item_bg {
        height: 6rem;
        width: 6rem;
        top: -3.75rem;
        right: -3.75rem;
    }
}

/* Ajustes para tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .ag-courses_item {
        flex: 1 1 calc(50% - 1rem);
    }
    
    .course-info-buttons .btn {
        flex: 1 1 calc(50% - 0.5rem);
    }
    
}

/* Ajustes para telas muito pequenas */
@media (max-width: 480px) {
    .course-preview {
        padding: 0.75rem;
    }
    
    .course-info {
        padding: 0.75rem;
    }
    
    .ag-courses-item_link {
        padding: 1rem 0.75rem;
    }
    
    .ag-courses-item_bg {
        height: 5rem;
        width: 5rem;
        top: -3.125rem;
        right: -3.125rem;
    }
    
    .course-info-buttons {
        flex-direction: column;
    }
    
    .course-info-buttons .btn {
        width: 100%;
    }
}

/* Garantir que imagens sejam responsivas */
.brasao {
    max-width: 100%;
    height: auto;
}

/* Melhorias de acessibilidade e performance */
.ag-courses-item_link:focus {
    outline: 2px solid #f9b234;
    outline-offset: 2px;
}

.btn:focus {
    outline: 2px solid #005b8f;
    outline-offset: 2px;
}

/* Transições suaves para todos os elementos interativos */
.course, .ag-courses-item_link, .btn {
    transition: all 0.3s ease;
}