/* ====================================================
   STANDARDIZED MESSAGE & ALERT STYLES
   ===================================================== */

/* Alert Container */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    animation: slideDown 0.3s ease-out;
    position: relative;
}

.alert i {
    flex-shrink: 0;
    font-size: 16px;
}

/* Alert Variants */
.alert-error,
.alert-danger {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ff9800;
}

.alert-info {
    background-color: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #2196f3;
}

/* Close Button for Alerts */
.alert-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: inherit;
    opacity: 0.7;
    padding: 0;
    margin-left: auto;
}

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

/* Hidden State */
.hidden,
.alert.hidden {
    display: none !important;
}

/* Error Message (inline) */
.error-message,
.form-error {
    color: #f44336;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Success Message (inline) */
.success-message,
.form-success {
    color: #4caf50;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Info Message (inline) */
.info-message,
.form-info {
    color: #2196f3;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Warning Message (inline) */
.warning-message {
    color: #ff9800;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
}

.toast-success {
    border-left: 4px solid #4caf50;
    color: #2e7d32;
}

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

.toast-warning {
    border-left: 4px solid #ff9800;
    color: #e65100;
}

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

.toast.fade-out {
    animation: slideOut 0.3s ease-out;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff5416;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
    margin: 0;
}

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.loading-state p {
    margin-top: 15px;
    color: #666;
    font-weight: 500;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

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

/* Form Validation Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff5416;
    box-shadow: 0 0 0 3px rgba(255, 84, 22, 0.1);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #f44336;
    background-color: #ffebee;
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* Checkbox & Radio Customization */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: auto;
    margin: 0;
}

.form-check label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
    flex: 1;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-danger {
    background: #ffebee;
    color: #c62828;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #e3f2fd;
    color: #1565c0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .alert {
        font-size: 13px;
        padding: 10px 12px;
    }

    .toast {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .spinner {
        width: 30px;
        height: 30px;
    }
}
