/* Brivo Unlock Card - Interactive booking-aware UI */
.brivo-unlock-card {
    max-width: 360px;
    margin: 24px auto;
    padding: 24px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    text-align: center;
    transition: box-shadow 0.25s ease, transform 0.2s ease;
}

.brivo-unlock-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
}

/* Active booking - subtle emphasis */
.brivo-unlock-card[data-active="1"] {
    border-color: rgba(34, 113, 177, 0.25);
    box-shadow: 0 4px 6px -1px rgba(34, 113, 177, 0.12), 0 2px 4px -2px rgba(34, 113, 177, 0.08);
}

.brivo-unlock-card[data-active="1"] .brivo-unlock-button:not(:disabled):hover {
    transform: scale(1.02);
}

/* Booking context section */
.brivo-booking-context {
    margin-bottom: 20px;
}

.brivo-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.brivo-badge-active {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

.brivo-badge-upcoming {
    background: rgba(34, 113, 177, 0.15);
    color: #1d4ed8;
}

.brivo-badge-grace {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.brivo-badge-always {
    background: rgba(79, 70, 229, 0.12);
    color: #3730a3;
}

.brivo-booking-message {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #334155;
}

/* Unlock button */
.brivo-unlock-button {
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.brivo-unlock-button:hover:not(:disabled) {
    filter: brightness(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.brivo-unlock-button:active:not(:disabled) {
    transform: scale(0.98);
}

.brivo-unlock-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.brivo-unlock-button.loading {
    pointer-events: none;
    position: relative;
}

.brivo-unlock-button.loading .brivo-button-text {
    opacity: 0;
}

.brivo-unlock-button.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: brivo-spin 0.7s linear infinite;
}

@keyframes brivo-spin {
    to { transform: rotate(360deg); }
}

.brivo-unlock-button .brivo-button-text {
    transition: opacity 0.2s;
}

/* Status message */
.brivo-status-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
    animation: brivo-fade-in 0.3s ease;
}

@keyframes brivo-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.brivo-status-message.success {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.3);
    display: block;
}

.brivo-status-message.error {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.25);
    display: block;
    white-space: pre-wrap;
}

.brivo-status-message.info {
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
    border: 1px solid rgba(100, 116, 139, 0.2);
    display: block;
}
