/* Modern Gradient Background */
body {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    min-height: 100vh;
    -webkit-overflow-scrolling: touch;
}

.dark body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* Glassmorphism Utilities */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.dark .glass {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.dark .glass-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

/* Animations */
.hover-bounce:hover {
    transform: translateY(-5px) scale(1.02);
}

.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

.icon-float {
    animation: floatIcon 3s ease-in-out infinite;
}

/* Page transition */
.page-transition {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.page-hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* Enhanced select styling for consistency across browsers */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
    cursor: pointer;
}

select::-ms-expand {
    display: none;
}

select:hover {
    border-color: #93c5fd !important;
}

select:focus {
    outline: none;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* SweetAlert2 custom styling */
.swal2-popup.glass-card {
    border-radius: 1.5rem;
    padding: 2rem;
}

.swal2-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.swal2-html-container {
    font-size: 1rem;
}

.swal2-confirm,
.swal2-cancel {
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    background-color: rgba(255, 255, 255, 0.7);
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Floating Dock Animation */
.dock-container {
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
}

.dock-item {
    transition: width 0.5s cubic-bezier(0.23, 1, 0.32, 1),
        background 0.4s ease,
        color 0.3s ease,
        box-shadow 0.4s ease,
        transform 0.2s ease;
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    position: relative;
    overflow: visible;
    cursor: pointer;
    will-change: width;
}

.dock-item:hover:not(.active) {
    background-color: rgba(148, 163, 184, 0.1);
    transform: scale(1.05);
}

.dock-item.active {
    width: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 8px 16px -4px rgba(59, 130, 246, 0.4), 0 4px 8px -2px rgba(59, 130, 246, 0.2);
}

.dock-item.active i {
    color: white;
}

.dock-label {
    max-width: 0;
    opacity: 0;
    white-space: nowrap;
    margin-left: 0;
    overflow: hidden;
    transition: max-width 0.5s cubic-bezier(0.23, 1, 0.32, 1),
        opacity 0.35s ease 0.15s,
        margin-left 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
}

.dock-item.active .dock-label {
    max-width: 100px;
    opacity: 1;
    margin-left: 0.5rem;
}

/* Hide Scrollbar for clean look */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* SweetAlert2 Custom Styling */
.swal2-popup.glass-card {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1) !important;
}

.dark .swal2-popup.glass-card {
    background: rgba(30, 41, 59, 0.95) !important;
    border-color: rgba(148, 163, 184, 0.1) !important;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5) !important;
}

.swal2-popup.glass-card .swal2-title {
    color: #1e293b !important;
}

.dark .swal2-popup.glass-card .swal2-title {
    color: #ffffff !important;
}

.swal2-popup.glass-card .swal2-html-container {
    color: #475569 !important;
}

.dark .swal2-popup.glass-card .swal2-html-container {
    color: #cbd5e1 !important;
}

.swal-confirm-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    font-weight: 700 !important;
    padding: 12px 24px !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 16px -4px rgba(59, 130, 246, 0.4) !important;
    border: none !important;
    transition: all 0.3s ease !important;
}

.swal-confirm-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 20px -4px rgba(59, 130, 246, 0.5) !important;
}

.swal-cancel-btn {
    background: #f1f5f9 !important;
    color: #475569 !important;
    font-weight: 700 !important;
    padding: 12px 24px !important;
    border-radius: 12px !important;
    border: none !important;
    transition: all 0.3s ease !important;
}

.dark .swal-cancel-btn {
    background: #334155 !important;
    color: #cbd5e1 !important;
}

.swal-cancel-btn:hover {
    background: #e2e8f0 !important;
}

.dark .swal-cancel-btn:hover {
    background: #475569 !important;
}

.swal-input {
    width: 100% !important;
    padding: 12px 16px !important;
    border-radius: 12px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    font-size: 16px !important;
    transition: all 0.3s ease !important;
}

.dark .swal-input {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #ffffff !important;
}

.swal-input:focus {
    outline: none !important;
    /* ring property is not standard CSS, using box-shadow for ring effect */
    box-shadow: 0 0 0 2px #3b82f6 !important;
    border-color: #3b82f6 !important;
}

.swal2-input-label {
    color: #475569 !important;
    font-weight: 500 !important;
}

.dark .swal2-input-label {
    color: #cbd5e1 !important;
}

/* Information Hub Tab Styling */
.info-tab-btn {
    color: #64748b;
    border-bottom: 3px solid transparent;
}

.info-tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.dark .info-tab-btn {
    color: #94a3b8;
}

.dark .info-tab-btn.active {
    color: #60a5fa;
    border-bottom-color: #60a5fa;
}

.info-tab-btn:hover:not(.active) {
    color: #475569;
    background-color: rgba(148, 163, 184, 0.05);
}

.dark .info-tab-btn:hover:not(.active) {
    color: #cbd5e1;
    background-color: rgba(148, 163, 184, 0.1);
}

.info-tab-content {
    animation: fadeIn 0.3s ease-in;
}

/* Skeleton Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #f1f5f9 4%, #e2e8f0 25%, #f1f5f9 36%);
    background-size: 1000px 100%;
}

.dark .skeleton {
    background: linear-gradient(to right, #1e293b 4%, #334155 25%, #1e293b 36%);
}

/* Auth Guard Popup Animations */
.animate-fade-in {
    animation: authFadeIn 0.3s ease-out;
}

.animate-scale-in {
    animation: authScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes authScaleIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Auth Loading State - Prevent Flash of Unauthenticated Content */
body:not(.auth-ready) [data-auth-show] {
    opacity: 0;
    pointer-events: none;
}

body.auth-ready [data-auth-show] {
    opacity: 1;
    transition: opacity 0.3s ease-out;
}

/* Hide login button when authenticated */
body.auth-ready [data-auth-hide] {
    display: none !important;
}