/**
 * Wethr Alerts Modal Styles
 */

/* Modal Overlay */
.wethr-alerts-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.wethr-alerts-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* Modal Content */
.wethr-alerts-modal-content {
    position: relative;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Modal Header */
.wethr-alerts-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
    background: #262626;
}

.wethr-alerts-modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wethr-alerts-modal-header h2 i {
    color: #FFD700;
}

.wethr-alerts-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.wethr-alerts-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Modal Body */
.wethr-alerts-modal-body {
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

/* Sections */
.alerts-section {
    margin-bottom: 24px;
}

.alerts-section:last-child {
    margin-bottom: 0;
}

.alerts-section-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

/* Push Notification Status */
.push-status {
    padding: 16px;
    background: #262626;
    border-radius: 8px;
    border: 1px solid #333;
}

.push-enabled, .push-disabled {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.push-enabled i {
    color: #4caf50;
    font-size: 1.2rem;
}

.push-disabled i {
    color: #666;
    font-size: 1.2rem;
}

.push-enabled span, .push-disabled span {
    flex: 1;
    color: #ccc;
}

/* Form Styles */
#create-alert-form {
    width: 100%;
    box-sizing: border-box;
}

.alert-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.form-group {
    flex: 1;
    min-width: 120px;
    box-sizing: border-box;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #888;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: #262626;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #FFD700;
}

.form-group input::placeholder {
    color: #666;
}

.form-group-submit {
    display: flex;
    align-items: flex-end;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-text {
    background: none;
    border: none;
    color: #888;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-text:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon {
    background: none;
    border: none;
    color: #888;
    font-size: 1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon.btn-enabled {
    color: #4caf50;
}

.btn-icon.btn-disabled {
    color: #666;
}

.btn-icon.btn-delete:hover {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

/* Alerts List */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alerts-empty {
    text-align: center;
    padding: 30px;
    color: #666;
}

.alerts-empty i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.alerts-empty p {
    margin: 0;
    font-size: 0.9rem;
}

/* Alert Item */
.alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #262626;
    border: 1px solid #333;
    border-radius: 8px;
    transition: all 0.2s;
}

.alert-item:hover {
    border-color: #444;
}

.alert-item.alert-disabled {
    opacity: 0.5;
}

.alert-item-main {
    flex: 1;
}

.alert-item-condition {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.alert-station {
    font-size: 0.7rem;
    font-weight: 600;
    color: #888;
    background: #333;
    padding: 2px 6px;
    border-radius: 3px;
}

.alert-type {
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
}

.alert-operator {
    font-size: 0.9rem;
    color: #FFD700;
    font-weight: 600;
}

.alert-threshold {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.alert-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-reset-mode {
    font-size: 0.7rem;
    color: #666;
    text-transform: uppercase;
}

.alert-trigger-count {
    font-size: 0.7rem;
    color: #4caf50;
}

.alert-item-actions {
    display: flex;
    gap: 4px;
}

/* Toast Notifications */
.wethr-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #333;
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 100001;
    opacity: 0;
    transition: all 0.3s ease;
}

.wethr-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.wethr-toast-success {
    border-left: 4px solid #4caf50;
}

.wethr-toast-success i {
    color: #4caf50;
}

.wethr-toast-error {
    border-left: 4px solid #f44336;
}

.wethr-toast-error i {
    color: #f44336;
}

.wethr-toast-info {
    border-left: 4px solid #2196f3;
}

.wethr-toast-info i {
    color: #2196f3;
}

/* Alert Icon Button (in chart header) */
.alerts-icon-btn {
    color: #777;
    cursor: pointer;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
}

.alerts-icon-btn:hover {
    color: #FFD700;
}

.alerts-icon-btn.has-alerts::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    border: 2px solid #1e1e1e;
}

/* Responsive */
@media (max-width: 600px) {
    .wethr-alerts-modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 10px;
    }
    
    .wethr-alerts-modal-body {
        padding: 15px;
    }
    
    .alert-form-row {
        flex-direction: column;
    }
    
    .form-group {
        min-width: 100%;
    }
    
    .alert-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .alert-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
