/*
 * NavEd Onboarding & Announcement Styles
 * Styles for the onboarding tour and feature announcement system
 * Bootstrap 4.6.2 compatible
 */

/* ==========================================================================
   ONBOARDING TOUR MODAL STYLES
   ========================================================================== */

/* Modal header customization */
#onboardingTourModal .modal-header {
    border-bottom: none;
    position: relative;
}

/* Ensure close button is visible against gradient */
#onboardingTourModal .modal-header .close {
    opacity: 1;
    text-shadow: none;
}

#onboardingTourModal .modal-header .close:hover {
    opacity: 0.8;
}

/* Modal footer styling */
#onboardingTourModal .modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.25rem;
}

/* Progress bar in modal header */
.tour-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.tour-progress-fill {
    height: 100%;
    background: #fff;
    transition: width 0.4s ease;
    border-radius: 2px;
}

/* Step content styling */
#tourStepContent {
    min-height: 300px;
}

/* Make main description text larger and more readable */
#tourStepContent > .text-center > p.text-muted,
#tourStepContent > div > p.text-muted {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #495057 !important; /* Slightly darker than default muted for readability */
}

/* Also increase the step heading size slightly */
#tourStepContent h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
}

/* Feature highlight cards in steps */
#tourStepContent .card {
    transition: transform 0.2s ease;
}

#tourStepContent .card:hover {
    transform: translateY(-2px);
}

/* Make feature card text larger and more readable */
#tourStepContent .card strong,
#tourStepContent .card .font-weight-bold {
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.25rem;
}

#tourStepContent .card p,
#tourStepContent .card .small,
#tourStepContent .card small {
    font-size: 0.95rem !important;
    line-height: 1.5;
    color: #6c757d;
}

/* Icon containers in steps */
#tourStepContent .bg-light.rounded-circle {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Opacity utility (Bootstrap 4 doesn't have this by default) */
.opacity-75 {
    opacity: 0.75 !important;
}

.opacity-50 {
    opacity: 0.5 !important;
}

/* Button animations */
#onboardingTourModal .btn {
    transition: all 0.2s ease;
}

#onboardingTourModal .btn:active {
    transform: scale(0.98);
}

/* ==========================================================================
   MOBILE RESPONSIVENESS - ONBOARDING
   ========================================================================== */

@media (max-width: 576px) {
    /* Make modal use more screen space on mobile */
    #onboardingTourModal .modal-lg {
        max-width: 95%;
        margin: 0.5rem auto;
    }

    /* Adjust padding for mobile */
    #onboardingTourModal .modal-body {
        padding: 1.5rem !important;
        min-height: 250px;
    }

    #onboardingTourModal .modal-header {
        padding: 1rem;
    }

    #onboardingTourModal .modal-footer {
        padding: 0.75rem 1rem;
    }

    /* Ensure buttons meet 44px WCAG minimum tap target */
    #onboardingTourModal .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.5rem 1rem;
    }

    /* Adjust font sizes for mobile while keeping them readable */
    #onboardingTourModal h4 {
        font-size: 1.35rem;
    }

    /* Keep description text readable on mobile */
    #tourStepContent > .text-center > p.text-muted,
    #tourStepContent > div > p.text-muted {
        font-size: 1.05rem;
    }

    #onboardingTourModal .fa-3x {
        font-size: 2.5rem;
    }

    /* Stack footer buttons on very small screens */
    @media (max-width: 400px) {
        #onboardingTourModal .modal-footer {
            flex-direction: column;
            gap: 0.5rem;
        }

        #onboardingTourModal .modal-footer > div {
            width: 100%;
            display: flex;
            justify-content: space-between;
        }

        #onboardingTourModal .modal-footer .btn {
            flex: 1;
            margin: 0 0.25rem !important;
        }
    }
}

/* ==========================================================================
   ANNOUNCEMENT SYSTEM STYLES
   ========================================================================== */

/* Announcement Modal */
#announcementModal .modal-header {
    border-bottom: none;
}

#announcementModal .modal-header .close {
    opacity: 1;
    text-shadow: none;
}

#announcementModal .modal-header .close:hover {
    opacity: 0.8;
}

#announcementModal .modal-footer {
    border-top: 1px solid #dee2e6;
}

/* Announcement Banner (fixed top) */
.announcement-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040; /* Below modals (1050) but above navbar (1030) */
    border-radius: 0;
    margin: 0;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Adjust content wrapper when banner is shown */
body.has-announcement-banner .content-wrapper {
    padding-top: 70px;
    transition: padding-top 0.3s ease;
}

/* Banner color variants */
.announcement-banner.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.announcement-banner.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.announcement-banner.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

/* Banner animations */
#announcementBanner {
    animation: slideDown 0.3s ease-out;
}

#announcementBanner.hiding {
    animation: slideUp 0.3s ease-out;
}

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

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

/* Announcement Badge (fixed bottom-right) */
.announcement-badge {
    position: fixed;
    bottom: 80px; /* Above feedback button */
    right: 20px;
    z-index: 1030;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    min-height: 44px; /* WCAG tap target minimum */
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.announcement-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.announcement-badge:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Pulse animation for badge */
.announcement-badge.pulse {
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    }
}

/* Badge color variants */
.announcement-badge.badge-info {
    background-color: #17a2b8;
    color: #fff;
}

.announcement-badge.badge-primary {
    background-color: #007bff;
    color: #fff;
}

.announcement-badge.badge-success {
    background-color: #28a745;
    color: #fff;
}

/* Ensure badge doesn't overlap with feedback button */
.feedback-floating-btn ~ .announcement-badge {
    bottom: 90px;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS - ANNOUNCEMENTS
   ========================================================================== */

@media (max-width: 576px) {
    /* Announcement Modal */
    #announcementModal .modal-dialog {
        margin: 0.5rem;
    }

    #announcementModal .modal-body {
        padding: 1.5rem !important;
    }

    #announcementModal .btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Stack modal footer on very small screens */
    @media (max-width: 400px) {
        #announcementModal .modal-footer {
            flex-direction: column;
            gap: 0.5rem;
        }

        #announcementModal .modal-footer > div {
            width: 100%;
        }

        #announcementModal .modal-footer .btn {
            width: 100%;
            margin-left: 0 !important;
            margin-top: 0.5rem;
        }

        #announcementModal .modal-footer .btn:first-child {
            margin-top: 0;
        }
    }

    /* Announcement Banner */
    .announcement-banner {
        font-size: 0.9rem;
        padding: 0.75rem;
    }

    .announcement-banner .btn-sm {
        min-height: 38px; /* Slightly smaller for space constraints */
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .announcement-banner .close {
        min-height: 38px;
        min-width: 38px;
    }

    /* Stack banner content on very small screens */
    @media (max-width: 400px) {
        .announcement-banner .d-flex.justify-content-between {
            flex-direction: column;
            align-items: flex-start !important;
        }

        .announcement-banner .d-flex.align-items-center:last-child {
            margin-top: 0.5rem;
            width: 100%;
        }
    }

    /* Announcement Badge */
    .announcement-badge {
        bottom: 70px;
        right: 15px;
        font-size: 0.85rem;
        padding: 0.45rem 0.65rem;
    }

    .feedback-floating-btn ~ .announcement-badge {
        bottom: 80px;
    }
}

/* ==========================================================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================================================== */

/* Ensure focus states are visible */
#onboardingTourModal .btn:focus,
#announcementModal .btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tour-progress-bar,
    .announcement-badge {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    #onboardingTourModal .btn,
    #announcementModal .btn,
    .announcement-badge,
    .tour-progress-fill,
    #announcementBanner {
        transition: none;
        animation: none;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    #onboardingTourModal,
    #announcementModal,
    .announcement-banner,
    .announcement-badge {
        display: none !important;
    }
}

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

/* Smooth transitions for dynamic content */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* Loading state */
.onboarding-loading {
    pointer-events: none;
    opacity: 0.6;
}

/* Success state for completed steps */
.step-completed {
    color: #28a745;
}

/* Error state */
.onboarding-error {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem 1.25rem;
    border-radius: 0.25rem;
}
