/******************* Alerts ******************/
#alerts {
    width: 100%;
    margin: auto;
    padding: 0 20px 60px;
    max-width: 700px;
}

/****************** Header ******************/

#alertsHeader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

#alertsTitle {
    font-weight: 700;
    font-size: 32px;
}

#alertsTier {
    display: none;
}

#alertsTier.active {
    display: block;
}

#alertsTier span {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tierFree {
    background-color: #EBEBEA;
    color: #666;
}

.tierPro {
    background-color: rgba(128, 0, 0, 0.1);
    color: var(--primary);
}

/**************** Usage ******************/

#alertsUsage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 16px;
}

#alertsUsageAlertsHeader,
#alertsUsageNotificationsHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

#alertsUsageAlertsHeaderLabel,
#alertsUsageNotificationsHeaderLabel {
    font-size: 13px;
    font-weight: 600;
    color: #8C8D8B;
}

#alertsUsageAlertsHeaderCount,
#alertsUsageNotificationsHeaderCount {
    font-size: 13px;
    font-weight: 600;
    color: #8C8D8B;
}

#alertsUsageAlertsBar,
#alertsUsageNotificationsBar {
    width: 100%;
    height: 6px;
    background-color: #EBEBEA;
    border-radius: 3px;
    overflow: hidden;
}

#alertsUsageAlertsBarFill,
#alertsUsageNotificationsBarFill {
    height: 100%;
    border-radius: 3px;
    background-color: #22C55E;
    width: 0%;
    transition: width 0.5s ease;
}

#alertsUsageAlertsBarFill.warning,
#alertsUsageNotificationsBarFill.warning {
    background-color: #FFCA28;
}

#alertsUsageAlertsBarFill.danger,
#alertsUsageNotificationsBarFill.danger {
    background-color: #EF4444;
}

#alertsUsageNotificationsReset {
    font-size: 11px;
    color: #8C8D8B;
    margin-top: 4px;
    min-height: 14px;
}

/**************** Upgrade ******************/

#alertsUpgrade {
    display: none;
}

#alertsUpgrade.active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 32px;
}

#alertsUpgradeText {
    font-size: 13px;
    color: #666;
}

#alertsUpgradeButton {
    white-space: nowrap;
    font-size: 12px;
    padding: 8px 20px;
}

/**************** Alert List ******************/

#alertsEmpty {
    display: none;
    text-align: center;
    color: #8C8D8B;
    padding: 40px 20px;
}

#alertsEmpty.active {
    display: block;
}

#alertsEmpty a {
    color: var(--primary);
    font-weight: 600;
}

#alertsList {
    display: none;
}

#alertsList.active {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.alertsListItem {
    border: 1px solid #EBEBEA;
    border-radius: 10px;
    padding: 20px;
}

.alertsListItemHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.alertsListItemHeaderTitle {
    font-size: 20px;
    font-weight: 500;
}

.alertsListItemHeaderStatus {
    background-color: rgba(34, 197, 94, 0.2);
    color: #22C55E;
    padding: 4px 8px;
    border-radius: 14px;
    font-weight: 500;
    font-size: 13px;
}

.alertsListItemLabel {
    font-size: 14px;
    color: #8C8D8B;
    margin-bottom: 15px;
}

.alertsListItemFilters {
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 10px;
    row-gap: 8px;
}

.alertsListItemFiltersItem {
    display: flex;
    gap: 6px;
    align-items: center;
}

.alertsListItemFiltersItemIcon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #FFCA28;
}

.alertsListItemFiltersItemLabel {
    font-size: 13px;
    color: #8C8D8B;
}

.alertsListItemActions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.alertsListItemActionsEdit {
    font-size: 13px;
    padding: 6px 20px;
}

.alertsListItemActionsDelete {
    background: none;
    border: none;
    color: #8C8D8B;
    font-size: 13px;
    text-decoration: underline;
    padding: 0;
    width: auto;
}

.alertsListItemActionsDelete:hover {
    color: #EF4444;
    background: none;
}

/**************** Alert Card Matches ******************/

.alertsListItemMatches {
    margin-bottom: 16px;
}

.alertsListItemMatchesToggle {
    background: none;
    border: none;
    padding: 0;
    width: auto;
    cursor: pointer;
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
}

.alertsListItemMatchesToggle:hover {
    text-decoration: underline;
    background: none;
}

.alertsListItemMatchesList {
    display: none;
    margin-top: 10px;
    border: 1px solid #EBEBEA;
    border-radius: 6px;
    overflow: hidden;
}

.alertsListItemMatchesList.active {
    display: block;
}

.alertsListItemMatchesItem {
    padding: 10px 12px;
    border-bottom: 1px solid #EBEBEA;
}

.alertsListItemMatchesItem:last-child {
    border-bottom: none;
}

.alertsListItemMatchesItemName {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alertsListItemMatchesItemName a {
    color: var(--primary);
}

.alertsListItemMatchesItemName a:hover {
    text-decoration: underline;
}

.alertsListItemMatchesItemDetails {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #8C8D8B;
    margin-top: 2px;
}

/**************** Notification History ******************/

#alertsHistory {
    margin-top: 40px;
}

#alertsHistoryTitle {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
}

#alertsHistoryEmpty {
    display: none;
    color: #8C8D8B;
    font-size: 14px;
}

#alertsHistoryEmpty.active {
    display: block;
}

#alertsHistoryList {
    display: none;
}

#alertsHistoryList.active {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background-color: #EBEBEA;
    border: 1px solid #EBEBEA;
    border-radius: 8px;
    overflow: hidden;
}

.alertsHistoryItem {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #fff;
    gap: 12px;
}

.alertsHistoryItemInfo {
    flex: 1;
    min-width: 0;
}

.alertsHistoryItemName {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alertsHistoryItemName a {
    color: var(--primary);
}

.alertsHistoryItemName a:hover {
    text-decoration: underline;
}

.alertsHistoryItemPrice {
    font-size: 13px;
    color: #8C8D8B;
}

.alertsHistoryItemTime {
    font-size: 12px;
    color: #8C8D8B;
    white-space: nowrap;
}

/**************** Responsive ******************/

@media (max-width: 800px) {
    #alertsTitle {
        font-size: 24px;
    }

    #alertsUsage {
        grid-template-columns: 1fr;
    }

    #alertsUpgrade.active {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}
