/* ============================
   LENDSEEK UI ENHANCEMENTS
   Maintains Brand Colors & Style
   ============================ */

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

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #20366a;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    z-index: 10000;
    transition: top 0.3s ease;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Focus indicators */
*:focus-visible {
    outline: 2px solid #20366a;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid #20366a;
    outline-offset: 3px;
}

/* ============================
   MOBILE NAVIGATION
   ============================ */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    transition: all 0.3s ease;
}

.mobile-menu-toggle .hamburger {
    width: 28px;
    height: 2px;
    background: #20366a;
    position: relative;
    transition: all 0.3s ease;
    display: block;
}

.mobile-menu-toggle .hamburger::before,
.mobile-menu-toggle .hamburger::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 2px;
    background: #20366a;
    transition: all 0.3s ease;
}

.mobile-menu-toggle .hamburger::before {
    top: -8px;
}

.mobile-menu-toggle .hamburger::after {
    top: 8px;
}

.mobile-menu-toggle.active .hamburger {
    background: transparent;
}

.mobile-menu-toggle.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.mobile-menu-toggle.active .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
}

/* Mobile Menu Overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
}

/* Mobile Navigation Panel */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow-y: auto;
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    padding: 80px 0 40px;
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav-links {
    padding: 24px 0;
}

.mobile-nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    color: #111;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.mobile-nav-links a:hover {
    background: #f7f9fc;
    border-left-color: #20366a;
    color: #20366a;
}

.mobile-nav-links a i,
.mobile-nav-links a svg {
    font-size: 18px;
    color: #20366a;
    width: 20px;
    height: 20px;
    stroke: #20366a;
    stroke-width: 2px;
    flex-shrink: 0;
}

.mobile-nav-links > div svg {
    width: 16px;
    height: 16px;
    stroke: #20366a;
    stroke-width: 2px;
    vertical-align: middle;
    margin-right: 6px;
}

.mobile-nav-submenu {
    padding-left: 48px;
    background: #f7f9fc;
}

.mobile-nav-submenu a {
    font-size: 15px;
    padding: 12px 24px;
}

.mobile-nav-actions {
    padding: 24px;
    border-top: 1px solid #e3e3e8;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-nav-actions .btn {
    width: 100%;
    text-align: center;
    padding: 14px;
}

/* ============================
   STICKY CTA BUTTON
   ============================ */

.sticky-cta {
    position: fixed;
    bottom: 100px;
    left: 24px;
    z-index: 997;
    opacity: 0;
    transform: translateY(100px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.sticky-cta.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.sticky-cta-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    background: linear-gradient(135deg, #20366a 0%, #162849 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 12px 32px rgba(32, 54, 106, 0.35);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.sticky-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(32, 54, 106, 0.45);
    color: #fff;
    text-decoration: none;
}

.sticky-cta-btn i {
    font-size: 18px;
}

.sticky-cta-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    animation: pulse 2s infinite;
}

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

/* ============================
   SOCIAL PROOF NOTIFICATIONS
   ============================ */

.social-proof-toast {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(32, 54, 106, 0.18);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 360px;
    z-index: 996;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 1px solid #e3e3e8;
}

.social-proof-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.social-proof-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #20366a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.social-proof-content {
    flex: 1;
}

.social-proof-text {
    font-size: 14px;
    color: #3b3b3b;
    font-weight: 500;
    margin-bottom: 2px;
    line-height: 1.4;
}

.social-proof-text strong {
    color: #20366a;
    font-weight: 600;
}

.social-proof-meta {
    font-size: 12px;
    color: #718096;
}

.social-proof-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    line-height: 1;
    transition: color 0.2s ease;
    align-self: flex-start;
}

.social-proof-close:hover {
    color: #3b3b3b;
}

/* ============================
   RESPONSIVE ADJUSTMENTS
   ============================ */

@media (max-width: 768px) {
    /* Show mobile menu components */
    .mobile-menu-toggle,
    .mobile-nav-overlay,
    .mobile-nav {
        display: block;
    }

    .mobile-nav-overlay.active {
        display: block;
    }

    /* Hide desktop navigation */
    .nav-links,
    .nav-actions .phone-link {
        display: none !important;
    }

    .nav-actions {
        gap: 8px;
    }

    .nav-actions .btn-outline {
        padding: 8px 16px;
        font-size: 14px;
    }

    .nav-actions .btn-primary {
        padding: 8px 16px;
        font-size: 14px;
    }

    /* Adjust sticky CTA for mobile - above social proof toast */
    .sticky-cta {
        bottom: 180px;
        left: 16px;
    }

    .sticky-cta-btn {
        padding: 14px 20px;
        font-size: 14px;
    }

    /* Adjust social proof for mobile */
    .social-proof-toast {
        left: 16px;
        right: 16px;
        max-width: none;
        bottom: 100px;
    }
}

@media (max-width: 480px) {
    .sticky-cta-btn span {
        display: none;
    }

    .sticky-cta-btn {
        width: 56px;
        height: 56px;
        padding: 0;
        justify-content: center;
    }

    .sticky-cta-btn i {
        margin: 0;
    }
}

/* ============================
   TRUST STATS
   ============================ */

.trust-stats-section {
    border-top: 1px solid #e3e3e8;
    border-bottom: 1px solid #e3e3e8;
}

.trust-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.trust-stat-item {
    text-align: center;
    padding: 20px;
    position: relative;
}

.trust-stat-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60px;
    background: #e3e3e8;
}

.trust-stat-item:last-child::after {
    display: none;
}

.trust-stat-icon {
    color: #20366a;
    font-size: 36px;
    margin-bottom: 16px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.trust-stat-item.animated .trust-stat-icon {
    opacity: 1;
    transform: scale(1);
}

.trust-stat-number {
    font-size: 48px;
    font-weight: 800;
    color: #20366a;
    line-height: 1;
    display: inline-block;
}

.trust-stat-suffix {
    font-size: 32px;
    font-weight: 700;
    color: #2952a3;
    display: inline-block;
    margin-left: 4px;
}

.trust-stat-label {
    font-size: 14px;
    color: #718096;
    font-weight: 600;
    margin-top: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile adjustments for trust stats */
@media (max-width: 992px) {
    .trust-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }

    .trust-stat-item:nth-child(2)::after {
        display: none;
    }
}

@media (max-width: 576px) {
    .trust-stats-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .trust-stat-item::after {
        display: none;
    }

    .trust-stat-number {
        font-size: 40px;
    }

    .trust-stat-suffix {
        font-size: 28px;
    }

    .trust-stat-icon {
        font-size: 32px;
    }
}

/* ============================
   LOADING STATES
   ============================ */

.skeleton {
    animation: skeleton-loading 1.5s infinite ease-in-out;
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-post-card {
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.skeleton-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite ease-in-out;
}

.skeleton-text {
    height: 16px;
    margin: 16px;
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite ease-in-out;
    border-radius: 4px;
}

.skeleton-text.short {
    width: 60%;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(32, 54, 106, 0.1);
    border-top-color: #20366a;
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}

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

/* Button loading state */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}
