/* ===================================
   UI/UX ENHANCEMENTS - Addon Edutech
   Global improvements for better user experience
   =================================== */

/* ===================================
   GLOBAL ENHANCEMENTS
   =================================== */

/* Ensure Bootstrap Icons (bi) always render - prevent override by other icon fonts */
.bi,
[class^="bi-"],
[class*=" bi-"] {
    font-family: "bootstrap-icons" !important;
    display: inline-block;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Better focus states for accessibility */
*:focus-visible {
    outline: 2px solid #0C4A86;
    outline-offset: 3px;
    border-radius: 4px;
}

/* Remove default button focus outline and add custom */
button:focus-visible,
a:focus-visible {
    outline: 2px solid #0C4A86;
    outline-offset: 2px;
}

/* ===================================
   LOADING STATES & SKELETONS
   =================================== */

/* Skeleton loading animation */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            #f0f0f0 0px,
            #f8f8f8 40px,
            #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: 8px;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0C4A86;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===================================
   ENHANCED BUTTONS
   =================================== */

.btn-enhanced {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-enhanced::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-enhanced:active::before {
    width: 300px;
    height: 300px;
}

/* Ripple effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ===================================
   ENHANCED CARDS
   =================================== */

.card-enhanced {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transition: left 0.5s;
}

.card-enhanced:hover::before {
    left: 100%;
}

.card-enhanced:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(12, 74, 134, 0.15);
}

/* ===================================
   ENHANCED FORMS
   =================================== */

.form-group-enhanced {
    position: relative;
    margin-bottom: 24px;
}

.form-label-enhanced {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.form-input-enhanced {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 18px;
    transition: all 0.3s ease;
    background: #ffffff;
}

.form-input-enhanced:focus {
    outline: none;
    border-color: #0C4A86;
    box-shadow: 0 0 0 3px rgba(12, 74, 134, 0.1);
}

.form-input-enhanced::placeholder {
    color: #9ca3af;
}

/* Floating label effect */
.form-floating-label {
    position: relative;
}

.form-floating-label input,
.form-floating-label textarea {
    padding-top: 24px;
    padding-bottom: 8px;
}

.form-floating-label label {
    position: absolute;
    top: 14px;
    left: 16px;
    font-size: 18px;
    color: #6a6f73;
    pointer-events: none;
    transition: all 0.3s ease;
}

.form-floating-label input:focus~label,
.form-floating-label input:not(:placeholder-shown)~label,
.form-floating-label textarea:focus~label,
.form-floating-label textarea:not(:placeholder-shown)~label {
    top: 6px;
    left: 16px;
    font-size: 12px;
    color: #0C4A86;
    font-weight: 600;
}

/* ===================================
   TOAST NOTIFICATIONS
   =================================== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    min-width: 300px;
    max-width: 400px;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid #0C4A86;
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast.info {
    border-left-color: #3b82f6;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: #6a6f73;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #6a6f73;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #1a1a1a;
}

/* ===================================
   ENHANCED MODALS
   =================================== */

.modal-enhanced {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-enhanced.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content-enhanced {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header-enhanced {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-title-enhanced {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.modal-close-enhanced {
    background: none;
    border: none;
    font-size: 24px;
    color: #6a6f73;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close-enhanced:hover {
    background: #f3f4f6;
    color: #1a1a1a;
}

/* ===================================
   ENHANCED TOOLTIPS
   =================================== */

.tooltip-enhanced {
    position: relative;
    display: inline-block;
}

.tooltip-enhanced .tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #ffffff;
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 1000;
    transition: opacity 0.3s, visibility 0.3s;
}

.tooltip-enhanced .tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1a1a1a;
}

.tooltip-enhanced:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ===================================
   ENHANCED SCROLLBAR
   =================================== */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* ===================================
   ENHANCED ANIMATIONS
   =================================== */

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.6s ease;
}

/* Slide in from bottom */
@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-up {
    animation: slideInUp 0.6s ease;
}

/* Scale in */
@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.scale-in {
    animation: scaleIn 0.4s ease;
}

/* ===================================
   ENHANCED MOBILE INTERACTIONS
   =================================== */

@media (max-width: 768px) {

    /* Better touch targets */
    button,
    a,
    input[type="button"],
    input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    @media (hover: none) {

        .card-enhanced:hover,
        .btn-enhanced:hover {
            transform: none;
        }
    }

    /* Better spacing for mobile */
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ===================================
   ACCESSIBILITY ENHANCEMENTS
   =================================== */

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: #0C4A86;
    color: #ffffff;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
}

.skip-to-main:focus {
    top: 0;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    * {
        border-color: currentColor !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
    .no-print {
        display: none !important;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }

    .btn,
    button {
        border: 1px solid #000;
    }
}