/* Security & Validation Styling */

/* Password Strength Indicator */
.password-strength {
    display: block;
    margin-top: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
}

.password-strength-weak {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
}

.password-strength-medium {
    background-color: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ff9800;
}

.password-strength-strong {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

/* Password Feedback */
.password-feedback {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
}

.password-feedback-error {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.password-feedback-success {
    background-color: #e8f5e8;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

/* Email Feedback */
.email-feedback {
    margin-top: 5px;
    padding: 5px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.email-feedback-error {
    background-color: #ffebee;
    color: #c62828;
}

.email-feedback-success {
    background-color: #e8f5e8;
    color: #2e7d32;
}

/* Security Notifications */
.security-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 500px;
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    animation: slideInRight 0.3s ease-out;
}

.security-notification-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.security-notification-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.security-notification-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.security-notification-info {
    background-color: #cce7ff;
    color: #004085;
    border: 1px solid #7dc3ff;
}

.notification-message {
    flex-grow: 1;
    margin-right: 10px;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Form Security Enhancements */
.secure-form {
    position: relative;
}

.secure-form .form-group {
    margin-bottom: 20px;
}

.secure-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.secure-form input[type="text"],
.secure-form input[type="email"],
.secure-form input[type="password"],
.secure-form select,
.secure-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.secure-form input:focus,
.secure-form select:focus,
.secure-form textarea:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.secure-form input:invalid {
    border-color: #f44336;
}

.secure-form input:valid {
    border-color: #4caf50;
}

/* Submit Button States */
.secure-form button[type="submit"],
.secure-form input[type="submit"] {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.secure-form button[type="submit"]:hover,
.secure-form input[type="submit"]:hover {
    background-color: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.secure-form button[type="submit"]:disabled,
.secure-form input[type="submit"]:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Rate Limiting Indicator */
.rate-limit-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 13px;
}

/* Security Badge */
.security-badge {
    display: inline-flex;
    align-items: center;
    background-color: #e8f5e8;
    color: #2e7d32;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.security-badge::before {
    content: "🔒";
    margin-right: 4px;
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4caf50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .security-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
    
    .password-feedback,
    .email-feedback {
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .secure-form input[type="text"],
    .secure-form input[type="email"],
    .secure-form input[type="password"],
    .secure-form select,
    .secure-form textarea {
        padding: 8px 10px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .secure-form input[type="text"],
    .secure-form input[type="email"],
    .secure-form input[type="password"],
    .secure-form select,
    .secure-form textarea {
        background-color: #2d2d2d;
        color: #fff;
        border-color: #555;
    }
    
    .secure-form label {
        color: #fff;
    }
    
    .password-strength-weak {
        background-color: #4a1a1a;
        color: #ff6b6b;
    }
    
    .password-strength-medium {
        background-color: #4a3a1a;
        color: #ffa726;
    }
    
    .password-strength-strong {
        background-color: #1a4a1a;
        color: #66bb6a;
    }
}