﻿/*
 * Warning Styles CSS - System-wide warning and notification styles
 * Use these classes throughout the system for consistent warning displays
 * 
 * Version: 1.0
 * Last Updated: August 2025
 */

/* ========================================
   ALERT/WARNING BOXES
   ======================================== */

/* Base alert styles */
.alert-base {
    padding: 12px 16px;
    margin: 10px 0;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.875rem;
    line-height: 1.4;
    position: relative;
}

/* Warning Alert */
.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
}

.alert-warning strong {
    color: #664d03;
}

/* Error/Danger Alert */
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.alert-danger strong {
    color: #491217;
}

/* Success Alert */
.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.alert-success strong {
    color: #0d4419;
}

/* Info Alert */
.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.2);
}

.alert-info strong {
    color: #062c33;
}

/* ========================================
   VALIDATION STYLES
   ======================================== */

/* Form validation errors */
.form-error {
    border: 2px solid #dc3545 !important;
    background-color: #fff5f5;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-error:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-warning {
    border: 2px solid #ffc107 !important;
    background-color: #fffaf0;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

.form-warning:focus {
    border-color: #ffc107 !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

.form-success {
    border: 2px solid #28a745 !important;
    background-color: #f8fff8;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-success:focus {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Error messages for form fields */
.field-error-message {
    color: #dc3545;
    font-size: 0.75rem;
    margin-top: 5px;
    display: block;
    font-weight: 500;
}

.field-warning-message {
    color: #856404;
    font-size: 0.75rem;
    margin-top: 5px;
    display: block;
    font-weight: 500;
}

.field-success-message {
    color: #155724;
    font-size: 0.75rem;
    margin-top: 5px;
    display: block;
    font-weight: 500;
}

/* ========================================
   BUTTONS WITH WARNING STATES
   ======================================== */

.btn-warning-outline {
    color: #856404;
    background-color: transparent;
    border: 2px solid #ffc107;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-warning-outline:hover {
    background-color: #ffc107;
    color: #000;
}

.btn-danger-outline {
    color: #721c24;
    background-color: transparent;
    border: 2px solid #dc3545;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger-outline:hover {
    background-color: #dc3545;
    color: #fff;
}

/* ========================================
   MODAL WARNING STYLES
   ======================================== */

.modal-warning .modal-header {
    background-color: #fff3cd;
    border-bottom: 1px solid #ffeaa7;
    color: #856404;
}

.modal-warning .modal-title {
    font-weight: 600;
    color: #664d03;
}

.modal-danger .modal-header {
    background-color: #f8d7da;
    border-bottom: 1px solid #f5c6cb;
    color: #721c24;
}

.modal-danger .modal-title {
    font-weight: 600;
    color: #491217;
}

.modal-success .modal-header {
    background-color: #d4edda;
    border-bottom: 1px solid #c3e6cb;
    color: #155724;
}

.modal-success .modal-title {
    font-weight: 600;
    color: #0d4419;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast-warning {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 16px 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    min-width: 300px;
    max-width: 500px;
    animation: slideInRight 0.3s ease-out;
}

.toast-danger {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 16px 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    min-width: 300px;
    max-width: 500px;
    animation: slideInRight 0.3s ease-out;
}

.toast-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 16px 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    min-width: 300px;
    max-width: 500px;
    animation: slideInRight 0.3s ease-out;
}

.toast-close {
    position: absolute;
    top: 8px;
    right: 12px;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    font-size: 1.125rem;
    line-height: 1;
    background: none;
    border: none;
}

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

/* ========================================
   BADGE WARNING STYLES
   ======================================== */

.badge-warning {
    background-color: #ffc107;
    color: #000;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-danger {
    background-color: #dc3545;
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-critical {
    background-color: #dc3545;
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
}

/* ========================================
   TABLE ROW WARNING STYLES
   ======================================== */

.table-row-warning {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107;
}

.table-row-danger {
    background-color: #f8d7da !important;
    border-left: 4px solid #dc3545;
}

.table-row-success {
    background-color: #d4edda !important;
    border-left: 4px solid #28a745;
}

/* ========================================
   ICON STYLES
   ======================================== */

.icon-warning {
    color: #ffc107;
    font-size: 1rem;
    margin-right: 8px;
}

.icon-danger {
    color: #dc3545;
    font-size: 1rem;
    margin-right: 8px;
}

.icon-success {
    color: #28a745;
    font-size: 1rem;
    margin-right: 8px;
}

.icon-info {
    color: #17a2b8;
    font-size: 1rem;
    margin-right: 8px;
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* ========================================
   LOADING STATES WITH WARNINGS
   ======================================== */

.loading-warning {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.loading-warning:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffc107;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .toast-warning,
    .toast-danger,
    .toast-success {
        position: fixed;
        top: 10px;
        left: 10px;
        right: 10px;
        min-width: auto;
        max-width: none;
    }
    
    .alert-base {
        padding: 10px 12px;
        font-size: 0.8125rem;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-warning {
    color: #856404 !important;
}

.text-danger {
    color: #721c24 !important;
}

.text-success {
    color: #155724 !important;
}

.bg-warning-light {
    background-color: #fff3cd !important;
}

.bg-danger-light {
    background-color: #f8d7da !important;
}

.bg-success-light {
    background-color: #d4edda !important;
}

.border-warning {
    border-color: #ffc107 !important;
}

.border-danger {
    border-color: #dc3545 !important;
}

.border-success {
    border-color: #28a745 !important;
}

/* ========================================
   MANDATORY FIELD INDICATORS
   ======================================== */

.required-field {
    position: relative;
}

.required-field label:after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

.required-indicator {
    color: #dc3545;
    font-weight: bold;
    margin-left: 3px;
}

/* ========================================
   SYSTEM-WIDE COMPATIBILITY
   ======================================== */

/* Override default styles to ensure compatibility */
.warning-override {
    box-sizing: border-box;
}

.warning-override * {
    box-sizing: border-box;
}

/* Print styles */
@media print {
    .toast-warning,
    .toast-danger,
    .toast-success {
        display: none !important;
    }
    
    .alert-warning,
    .alert-danger,
    .alert-success {
        border: 2px solid #000 !important;
        background: #fff !important;
        color: #000 !important;
    }
}
