/**
 * Seamless Authentication UI Styles for iCentral AI Notes
 * 
 * Provides clean, professional styling for authentication status indicators,
 * banners, modals, and progress indicators that integrate seamlessly with
 * the existing application design.
 */



/* Authentication Banner */
.auth-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 12px 20px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

.auth-banner-info {
    background: #E3F2FD;
    color: #1976D2;
    border-bottom: 2px solid #2196F3;
}

.auth-banner-warning {
    background: #FFF3E0;
    color: #F57C00;
    border-bottom: 2px solid #FF9800;
}

.auth-banner-error {
    background: #FFEBEE;
    color: #D32F2F;
    border-bottom: 2px solid #F44336;
}

.auth-banner-success {
    background: #E8F5E8;
    color: #388E3C;
    border-bottom: 2px solid #4CAF50;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Authentication Error Modal */
.auth-error-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.auth-error-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.auth-error-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.auth-error-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.auth-error-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.auth-error-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.auth-error-modal-body {
    padding: 24px;
}

.auth-error-message {
    margin-bottom: 24px;
    line-height: 1.6;
    color: #555;
}

.auth-error-message p {
    margin: 0 0 12px 0;
}

.auth-error-message p:last-child {
    margin-bottom: 0;
}

.auth-error-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.auth-error-actions .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.auth-error-actions .btn-primary {
    background: #2196F3;
    color: white;
}

.auth-error-actions .btn-primary:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

.auth-error-actions .btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.auth-error-actions .btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Authentication Progress Indicator */
.auth-progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1002;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.auth-progress-content {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.auth-progress-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px auto;
}

.auth-progress-message {
    color: #666;
    font-size: 16px;
    font-weight: 500;
}

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

/* Responsive Design */
@media (max-width: 768px) {


    .auth-banner {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .auth-error-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .auth-error-modal-header {
        padding: 16px 20px;
    }
    
    .auth-error-modal-body {
        padding: 20px;
    }
    
    .auth-error-actions {
        flex-direction: column;
    }
    
    .auth-error-actions .btn {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .auth-progress-content {
        padding: 30px 20px;
        margin: 20px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {

    .auth-banner {
        border-bottom-width: 3px;
    }
    
    .auth-error-modal {
        background: rgba(0, 0, 0, 0.8);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .auth-banner,
    .auth-error-modal,
    .auth-error-modal-content,
    .auth-progress-indicator {
        animation: none;
        transition: none;
    }

    .auth-progress-spinner {
        animation: none;
        border-top-color: transparent;
    }
    

    .auth-error-actions .btn:hover {
        transform: none;
    }
}

/* Emergency Authentication Modal */
.emergency-auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1003;
    background: rgba(244, 67, 54, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: emergencyFadeIn 0.3s ease;
}

.emergency-auth-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(244, 67, 54, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: emergencySlideUp 0.3s ease;
    border: 3px solid #F44336;
}

.emergency-auth-modal-header {
    padding: 24px;
    background: linear-gradient(135deg, #F44336, #D32F2F);
    color: white;
    text-align: center;
}

.emergency-auth-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.emergency-auth-modal-body {
    padding: 24px;
}

.emergency-auth-modal-body p {
    margin: 0 0 16px 0;
    line-height: 1.6;
    color: #333;
}

.emergency-auth-modal-body p:last-of-type {
    margin-bottom: 24px;
}

.emergency-auth-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.emergency-auth-actions .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 140px;
}

.emergency-auth-actions .btn-primary {
    background: #F44336;
    color: white;
}

.emergency-auth-actions .btn-primary:hover {
    background: #D32F2F;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.emergency-auth-actions .btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #ddd;
}

.emergency-auth-actions .btn-secondary:hover {
    background: #e0e0e0;
    border-color: #bbb;
    transform: translateY(-2px);
}

@keyframes emergencyFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes emergencySlideUp {
    from {
        transform: translateY(50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Security Status Indicators */
.security-status-indicator {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 1000;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.security-status-indicator.secure {
    background: rgba(76, 175, 80, 0.1);
    color: #388E3C;
    border: 2px solid #4CAF50;
}

.security-status-indicator.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #F57C00;
    border: 2px solid #FFC107;
}

.security-status-indicator.critical {
    background: rgba(244, 67, 54, 0.1);
    color: #D32F2F;
    border: 2px solid #F44336;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Emergency Mode Banner */
.emergency-mode-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background: linear-gradient(135deg, #F44336, #D32F2F);
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    animation: emergencyBannerSlide 0.3s ease;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.emergency-mode-banner::before {
    content: "🚨";
    margin-right: 8px;
    font-size: 16px;
}

@keyframes emergencyBannerSlide {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Security Audit Results */
.security-audit-results {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 300px;
    font-size: 12px;
    display: none;
}

.security-audit-results.show {
    display: block;
    animation: slideInFromRight 0.3s ease;
}

.security-audit-results h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #333;
}

.security-audit-results .audit-metric {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.security-audit-results .audit-metric:last-child {
    margin-bottom: 0;
}

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

/* Responsive Design for Security Components */
@media (max-width: 768px) {
    .emergency-auth-modal-content {
        width: 95%;
        margin: 20px;
    }

    .emergency-auth-modal-header {
        padding: 20px;
    }

    .emergency-auth-modal-body {
        padding: 20px;
    }

    .emergency-auth-actions {
        flex-direction: column;
    }

    .emergency-auth-actions .btn {
        width: 100%;
        margin-bottom: 8px;
    }

    .security-status-indicator {
        top: 60px;
        right: 10px;
        font-size: 11px;
        padding: 6px 10px;
    }

    .emergency-mode-banner {
        padding: 10px 15px;
        font-size: 13px;
    }

    .security-audit-results {
        bottom: 10px;
        right: 10px;
        max-width: 250px;
        padding: 12px;
    }
}

/* High Contrast Mode Support for Security Components */
@media (prefers-contrast: high) {
    .emergency-auth-modal-content {
        border-width: 4px;
    }

    .security-status-indicator {
        border-width: 3px;
    }

    .emergency-mode-banner {
        border-bottom: 4px solid #B71C1C;
    }
}

/* Reduced Motion Support for Security Components */
@media (prefers-reduced-motion: reduce) {
    .emergency-auth-modal,
    .emergency-auth-modal-content,
    .emergency-mode-banner,
    .security-audit-results {
        animation: none;
        transition: none;
    }

    .security-status-indicator.critical {
        animation: none;
    }

    .emergency-auth-actions .btn:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .auth-banner,
    .auth-error-modal,
    .auth-progress-indicator,
    .emergency-auth-modal,
    .security-status-indicator,
    .emergency-mode-banner,
    .security-audit-results {
        display: none !important;
    }
}
