/**
 * CREHQ Alerts CSS
 * Styles for alert modals, buttons, and management UI
 */

/* Alert Modal */
.crehq-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.crehq-modal.hidden {
    display: none;
}

.crehq-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.crehq-modal-content {
    position: relative;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.crehq-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.15s;
}

.crehq-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.crehq-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.crehq-modal-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #7c3aed 100%);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crehq-modal-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: white;
}

.crehq-modal-header h3 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.crehq-modal-header p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Form Elements */
.crehq-form-group {
    margin-bottom: 1rem;
}

.crehq-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.crehq-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.crehq-select,
.crehq-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    color: #111827;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.crehq-select:focus,
.crehq-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.crehq-form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.crehq-btn-primary,
.crehq-btn-secondary {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.crehq-btn-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #7c3aed 100%);
    color: white;
    border: none;
}

.crehq-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.crehq-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.crehq-btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.crehq-btn-secondary:hover {
    background: #f9fafb;
}

/* Success State */
.crehq-success-message {
    text-align: center;
    padding: 1rem 0;
}

.crehq-success-message .success-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    color: #059669;
}

.crehq-success-message h4 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.crehq-success-message p {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.crehq-link {
    color: #1e40af;
    font-size: 0.875rem;
    text-decoration: none;
}

.crehq-link:hover {
    text-decoration: underline;
}

/* Loading Spinner */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Alert Button Styles */
.crehq-alert-btn,
.crehq-follow-btn {
    transition: all 0.15s ease;
}

.crehq-alert-btn:hover,
.crehq-follow-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Alert Management Section (Account Settings) */
.crehq-alerts-section {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.crehq-alerts-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.crehq-alerts-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.crehq-alerts-list {
    max-height: 400px;
    overflow-y: auto;
}

.crehq-alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.crehq-alert-item:last-child {
    border-bottom: none;
}

.crehq-alert-item:hover {
    background: #f9fafb;
}

.crehq-alert-info {
    flex: 1;
}

.crehq-alert-info h4 {
    margin: 0 0 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
}

.crehq-alert-info p {
    margin: 0;
    font-size: 0.75rem;
    color: #6b7280;
}

.crehq-alert-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.crehq-alert-toggle {
    position: relative;
    width: 2.5rem;
    height: 1.5rem;
    background: #d1d5db;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s;
}

.crehq-alert-toggle.active {
    background: #3b82f6;
}

.crehq-alert-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.25rem;
    height: 1.25rem;
    background: white;
    border-radius: 9999px;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.crehq-alert-toggle.active::after {
    transform: translateX(1rem);
}

.crehq-alert-delete {
    padding: 0.375rem;
    color: #9ca3af;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s;
}

.crehq-alert-delete:hover {
    background: #fef2f2;
    color: #dc2626;
}

.crehq-alerts-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: #6b7280;
}

.crehq-alerts-empty svg {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 640px) {
    .crehq-modal-content {
        max-width: 100%;
        margin: 1rem;
    }
    
    .crehq-form-row {
        grid-template-columns: 1fr;
    }
}
