/* Food Alerts Carousel Styles for Filament */

.food-alerts-carousel-wrapper {
    position: relative;
    width: 100% !important;
    max-width: none !important;
    margin: 0;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: visible;
}

/* Force full width for the widget */
.fi-wi-widget {
    width: 100% !important;
    max-width: none !important;
    grid-column: 1 / -1 !important;
    overflow: visible !important;
}

.fi-wi-content {
    width: 100% !important;
    max-width: none !important;
    overflow: visible !important;
}

.fi-wi-header {
    width: 100% !important;
}

/* Override any Filament grid constraints */
[data-filament-widgets] > * {
    grid-column: span 12 !important;
}

.food-alerts-carousel-wrapper .embla {
    position: relative;
    width: 100%;
    overflow: hidden;
    z-index: 1;
    border-radius: 0 0 0.75rem 0.75rem;
}

.food-alerts-carousel-wrapper .embla__viewport {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.food-alerts-carousel-wrapper .embla__container {
    display: flex;
    flex-direction: row;
    transition: transform 0.3s ease-in-out;
    will-change: transform;
}

.food-alerts-carousel-wrapper .embla__slide {
    min-width: 100%;
    width: 100%;
    height: auto;
    max-width: 100%;
    box-sizing: border-box;
    flex: 0 0 100%;
}

.food-alerts-carousel-wrapper .embla__controls {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 50;
}

.food-alerts-carousel-wrapper .embla__buttons {
    position: relative;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.food-alerts-carousel-wrapper .embla__button {
    pointer-events: auto;
    width: 3rem;
    height: 3rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 8px 25px -5px rgba(59, 130, 246, 0.15);
    color: rgb(59, 130, 246);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    z-index: 100;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.food-alerts-carousel-wrapper .embla__button--prev {
    left: -2rem;
}

.food-alerts-carousel-wrapper .embla__button--next {
    right: -2rem;
}

.food-alerts-carousel-wrapper .embla__button:hover {
    background: rgba(59, 130, 246, 0.95);
    color: white;
    border-color: rgba(59, 130, 246, 0.8);
    transform: scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05),
        0 20px 25px -5px rgba(59, 130, 246, 0.25);
}

.food-alerts-carousel-wrapper .embla__button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.food-alerts-carousel-wrapper .embla__button:disabled:hover {
    background: rgba(255, 255, 255, 0.98);
    color: rgb(59, 130, 246);
    border-color: rgba(59, 130, 246, 0.2);
    transform: none;
}

.food-alerts-carousel-wrapper .embla__button__svg {
    width: 1.5rem;
    height: 1.5rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.food-alerts-carousel-wrapper .embla__dots {
    position: absolute;
    bottom: -12rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    padding: 0.75rem 1rem;
    border-radius: 2rem;
    border: 2px solid rgba(59, 130, 246, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    width: fit-content;
    z-index: 60;
}

.food-alerts-carousel-wrapper .embla__dot {
    width: 0.75rem;
    height: 0.75rem;
    background: rgb(203, 213, 225);
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.food-alerts-carousel-wrapper .embla__dot:hover {
    background: rgb(148, 163, 184);
    transform: scale(1.1);
}

.food-alerts-carousel-wrapper .embla__dot--selected {
    background: rgb(59, 130, 246);
    border-color: rgba(59, 130, 246, 0.3);
    transform: scale(1.2);
}

/* Alert Card Styles */
.alert-card {
    background: white;
    border-radius: 0;
    box-shadow: none;
    border: none;
    overflow: hidden;
    margin: 0 1rem;
    width: calc(100% - 2rem);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.alert-card .alert-header {
    padding: 1.5rem;
    padding-bottom: 1rem;
}

.alert-card .alert-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.alert-card .alert-type-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 1px solid;
}

.alert-card .alert-type-badge--food {
    background: rgb(254, 242, 242);
    color: rgb(185, 28, 28);
    border-color: rgba(185, 28, 28, 0.2);
}

.alert-card .alert-type-badge--allergy {
    background: rgb(255, 247, 237);
    color: rgb(194, 65, 12);
    border-color: rgba(194, 65, 12, 0.2);
}

.alert-card .nations-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgb(239, 246, 255);
    color: rgb(29, 78, 216);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: 1px solid rgba(29, 78, 216, 0.2);
}

.alert-card .date-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgb(249, 250, 251);
    color: rgb(75, 85, 99);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: 1px solid rgba(75, 85, 99, 0.2);
}

.alert-card .alert-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: rgb(17, 24, 39);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    /* Single line with ellipsis */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.alert-card .alert-description {
    color: rgb(75, 85, 99);
    margin-bottom: 1rem;
    max-width: none;
    line-height: 1.6;
    /* Two lines with ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: calc(1.6em * 2); /* Fixed height for 2 lines */
}

.alert-card .alert-content {
    padding: 0 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.alert-card .allergens-section {
    background: linear-gradient(
        135deg,
        rgb(254, 249, 195) 0%,
        rgb(254, 240, 138) 100%
    );
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-card .allergens-title {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(146, 64, 14);
}

.alert-card .allergens-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.alert-card .allergen-tag {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    color: rgb(146, 64, 14);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.alert-card .nations-section {
    margin-bottom: 1rem;
}

.alert-card .nations-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(55, 65, 81);
    margin-bottom: 0.5rem;
}

.alert-card .nations-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.alert-card .nation-tag {
    padding: 0.25rem 0.75rem;
    background: rgb(243, 244, 246);
    color: rgb(55, 65, 81);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.5rem;
}

.alert-card .alert-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid rgb(229, 231, 235);
}

.alert-card .alert-id {
    font-size: 0.75rem;
    color: rgb(107, 114, 128);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas,
        "Liberation Mono", Menlo, monospace;
}

.alert-card .view-full-alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgb(59, 130, 246);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.alert-card .view-full-alert:hover {
    background: rgb(37, 99, 235);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Icon Sizing */
.alert-card .w-3 {
    width: 0.75rem !important;
    height: 0.75rem !important;
    flex-shrink: 0;
}

.alert-card .w-4 {
    width: 1rem !important;
    height: 1rem !important;
    flex-shrink: 0;
}

.alert-card .w-5 {
    width: 1.25rem !important;
    height: 1.25rem !important;
    flex-shrink: 0;
}

.alert-card .w-6 {
    width: 1.5rem !important;
    height: 1.5rem !important;
    flex-shrink: 0;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .food-alerts-carousel-wrapper .embla__button {
        background: rgba(31, 41, 55, 0.95);
        color: rgb(96, 165, 250);
        border-color: rgba(96, 165, 250, 0.3);
    }

    .food-alerts-carousel-wrapper .embla__button:hover {
        background: rgba(96, 165, 250, 0.9);
        color: white;
        border-color: rgba(96, 165, 250, 0.8);
    }

    .food-alerts-carousel-wrapper .embla__dots {
        background: rgba(31, 41, 55, 0.95);
        border-color: rgba(96, 165, 250, 0.2);
    }

    .food-alerts-carousel-wrapper .embla__dot {
        background: rgb(75, 85, 99);
    }

    .food-alerts-carousel-wrapper .embla__dot--selected {
        background: rgb(96, 165, 250);
    }

    .alert-card {
        background: rgb(31, 41, 55);
        border-color: rgba(75, 85, 99, 0.3);
    }

    .alert-card .alert-title {
        color: rgb(243, 244, 246);
    }

    .alert-card .alert-description {
        color: rgb(156, 163, 175);
    }
}
