/* Alerts specific styling - matches existing fintech design system */

/* Alert Management Container */
.alerts-container {
    width: 1400px;
    padding: 2em;
    margin: 0 auto;
    max-width: 100%;
}

.alerts-header {
    text-align: center;
    margin-bottom: 2rem;
}

.alerts-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.alerts-header p {
    color: #64748b;
    font-size: 1rem;
}

/* Alert Main Content Layout - STACKED VERTICALLY */
.alerts-main-content {
    display: block;
}

.alerts-main-content .card {
    margin-bottom: 2rem;
}

/* Alert Form Styling */
.alerts-form-group {
    margin-bottom: 1.5rem;
}

.alerts-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.alerts-form-control {
    width: 100%;
    padding: 0.75rem;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    color: var(--dark-color);
    font-size: 0.875rem;
    transition: all var(--transition-speed) ease;
}

.alerts-form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(36, 100, 235, 0.1);
}

.alerts-form-control option {
    background: #fff;
    color: var(--dark-color);
}

/* Alert Script Selector */
.alerts-script-selector {
    background-color: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-top: 1rem;
}

.alerts-script-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: center;
}

.alerts-script-controls select {
    flex: 1;
}

.alerts-selected-scripts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.alerts-script-tag {
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.alerts-script-tag .remove {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.7;
    transition: opacity var(--transition-speed);
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.alerts-script-tag .remove:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.3);
}

/* Alert List Styling */
.alerts-list {
    max-height: 600px;
    overflow-y: auto;
}

.alerts-item {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    transition: all var(--transition-speed) ease;
}

.alerts-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px rgba(36, 100, 235, 0.1);
}

.alerts-item.inactive {
    opacity: 0.6;
    background-color: #f8fafc;
}

.alerts-item.inactive .alerts-type {
    color: #64748b;
}

.alerts-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--light-color);
}

.alerts-type {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
}

.alerts-actions {
    display: flex;
    gap: 0.5rem;
}

.alerts-details {
    padding: 1rem 1.5rem;
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* iOS Toggle Switch for Alerts */
.alerts-ios-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    margin-right: 0.75rem;
    background-color: #cbd5e1;
    border-radius: 28px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    vertical-align: middle;
    border: 2px solid #e2e8f0;
    box-sizing: border-box;
}

.alerts-ios-switch.active {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.alerts-ios-switch-handle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.alerts-ios-switch.active .alerts-ios-switch-handle {
    transform: translateX(22px);
}

.alerts-ios-switch:hover .alerts-ios-switch-handle {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transform: scale(1.1);
}

.alerts-ios-switch.active:hover .alerts-ios-switch-handle {
    transform: translateX(22px) scale(1.1);
}

.alerts-status-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    margin-left: 0.5rem;
}

.alerts-status-label.active {
    color: var(--success-color);
}

/* Alert Conditional Fields - UPDATED FOR KNOCKOUTJS COMPATIBILITY */
.alerts-conditional-fields {
    /* Removed display: none - KnockoutJS visible binding handles this automatically */
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Removed .alerts-conditional-fields.show class as KnockoutJS handles visibility */

/* Alert Form Buttons */
.alerts-form-button-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 2rem;
    align-items: stretch;
}

.alerts-form-button-group .btn-primary {
    flex: 1;
}

.alerts-form-button-group .btn-outline-danger {
    min-width: 100px;
    text-align: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
}

/* Alert Confirmation Modal */
.alerts-confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.alerts-confirm-modal.show {
    display: flex;
}

.alerts-confirm-modal-content {
    background-color: #fff;
    border-radius: 0.5rem;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--hover-shadow);
}

.alerts-confirm-modal-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.alerts-confirm-modal-body {
    color: #64748b;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.alerts-confirm-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Empty State */
.alerts-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #64748b;
}

.alerts-empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .alerts-container {
        width: 100%;
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .alerts-script-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .alerts-form-button-group {
        flex-direction: column;
    }
}

/* Input Focus States */
.alerts-form-control:focus,
input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(36, 100, 235, 0.1);
}