/* Cards de extensão - Versão Melhorada e Responsiva */

:root {
    --verde1: rgb(53, 152, 48);
    --verde2: rgb(44, 68, 32);
    --vermelho1: rgb(201, 12, 15);
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Container dos cards */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Card principal */
.event-card.custom-card {
    width: 100%;
    max-width: 1000px;
    min-height: 280px;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    margin: 0 auto;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    border: none;
    position: relative;
}

.event-card.custom-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
}

/* Imagem do card */
.custom-card-img {
    width: 45%;
    min-width: 45%;
    height: 100%;
    min-height: 280px;
    object-fit: cover;
    border-radius: 20px 0 0 20px;
    transition: transform 0.4s ease;
}

.event-card.custom-card:hover .custom-card-img {
    /* transform: scale(1.05); */
}

/* Body do card */
.card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0;
    position: relative;
}

.card-main-content {
    flex: 1;
    padding: 1.8rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Título do evento */
.event-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    color: var(--verde1);
    margin-bottom: 0;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cursos e data */
.event-courses {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem;
    color: #666;
    font-size: 0.9rem;
}

.event-courses i {
    color: var(--verde1);
    font-size: 1rem;
}

.event-courses span {
    display: inline-flex;
    align-items: center;
}

/* Descrição */
.event-description {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
}

.event-description span {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Container dos speakers/membros */
.speakers-container {
    margin-top: auto;
    width: 100%;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.speakers-container.carousel {
    position: relative;
}

.carousel-inner {
    padding: 0.8rem 0;
}

/* Speaker individual */
.speaker {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 2rem;
    transition: background-color 0.3s ease;
}

.speaker:hover {
    background-color: rgba(53, 152, 48, 0.05);
}

.speaker-image {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--verde1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.speaker-info {
    flex: 1;
    min-width: 0;
}

.speaker-info h4 {
    font-family: 'Montserrat', sans-serif;
    color: var(--verde1);
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.speaker-info p {
    color: #666;
    margin: 0;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Controles do carrossel */
.carousel-control-prev,
.carousel-control-next {
    width: 40px;
    height: 40px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.carousel-control-prev {
    left: 10px;
}

.carousel-control-next {
    right: 10px;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: var(--verde1);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    background-size: 16px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Botões de ação */
.card-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.btn-edit,
.btn-x {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    opacity: 0.9;
}

.btn-edit {
    background-color: #0d6efd;
    color: white;
}

.btn-edit:hover {
    background-color: #0b5ed7;
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 4px 16px rgba(13, 110, 253, 0.4);
    opacity: 1;
}

.btn-x {
    background-color: #dc3545;
    color: white;
}

.btn-x:hover {
    background-color: #bb2d3b;
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.4);
    opacity: 1;
}

/* Estado de loading */
.events-list:empty::before {
    content: 'Carregando projetos...';
    display: block;
    text-align: center;
    padding: 3rem;
    color: #999;
    font-size: 1.1rem;
}

/* Responsividade */

/* Tablets */
@media (max-width: 992px) {
    .event-card.custom-card {
        min-height: 260px;
    }

    .custom-card-img {
        min-height: 260px;
    }

    .card-main-content {
        padding: 1.5rem 1.5rem;
    }

    .event-title {
        font-size: 1.3rem;
    }

    .speaker {
        padding: 0.6rem 1.5rem;
    }
}

/* Mobile Landscape */
@media (max-width: 768px) {
    .event-card.custom-card {
        flex-direction: column;
        min-height: auto;
        max-width: 600px;
    }

    .custom-card-img {
        width: 100%;
        height: 220px;
        min-height: 220px;
        border-radius: 20px 20px 0 0;
    }

    .card-main-content {
        padding: 1.5rem;
    }

    .event-title {
        font-size: 1.4rem;
        -webkit-line-clamp: 3;
    }

    .event-courses {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .speaker {
        padding: 0.8rem 1.5rem;
    }

    .speaker-image {
        width: 55px;
        height: 55px;
        min-width: 55px;
    }

    .speaker-info h4 {
        font-size: 1rem;
    }

    .speaker-info p {
        font-size: 0.9rem;
    }

    .card-actions {
        top: 8px;
        right: 8px;
    }

    .btn-edit,
    .btn-x {
        width: 36px;
        height: 36px;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 35px;
        height: 35px;
    }

    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 28px;
        height: 28px;
        background-size: 14px 14px;
    }
}

/* Mobile Portrait */
@media (max-width: 576px) {
    .events-list {
        padding: 0 0.5rem;
    }

    .event-card.custom-card {
        border-radius: 16px;
        margin: 0;
    }

    .custom-card-img {
        height: 200px;
        min-height: 200px;
        border-radius: 16px 16px 0 0;
    }

    .card-main-content {
        padding: 1.2rem;
        gap: 0.8rem;
    }

    .event-title {
        font-size: 1.2rem;
    }

    .event-courses {
        font-size: 0.85rem;
    }

    .event-description {
        font-size: 0.9rem;
    }

    .event-description span {
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .speaker {
        padding: 0.6rem 1.2rem;
        gap: 0.8rem;
    }

    .speaker-image {
        width: 48px;
        height: 48px;
        min-width: 48px;
    }

    .speaker-info h4 {
        font-size: 0.95rem;
    }

    .speaker-info p {
        font-size: 0.85rem;
    }

    .card-actions {
        gap: 6px;
    }

    .btn-edit,
    .btn-x {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }
}

/* Extra Small Devices */
@media (max-width: 400px) {
    .event-card.custom-card {
        border-radius: 12px;
    }

    .custom-card-img {
        height: 180px;
        min-height: 180px;
        border-radius: 12px 12px 0 0;
    }

    .card-main-content {
        padding: 1rem;
    }

    .event-title {
        font-size: 1.1rem;
    }

    .speaker {
        padding: 0.5rem 1rem;
    }

    .speaker-image {
        width: 45px;
        height: 45px;
        min-width: 45px;
    }
}

/* Animações */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event-card.custom-card {
    animation: slideIn 0.5s ease-out;
}

/* Previne seleção de texto ao clicar no card */
.event-card * {
    user-select: none;
}

/* Permite seleção de texto na modal */
.modal-body * {
    user-select: text;
}

/* Melhorias de acessibilidade */
.event-card:focus-within {
    outline: 3px solid var(--verde1);
    outline-offset: 2px;
}

.btn-edit:focus,
.btn-x:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .event-card.custom-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .btn-edit,
    .btn-x,
    .carousel-control-prev,
    .carousel-control-next {
        display: none !important;
    }
}