/* SkillCoin Platform - Custom Styles */

/* 顶栏：导航链接与用户区字号（站点标题单独更大，见下方 .skillcoin-navbar-brand） */
.skillcoin-navbar .navbar-nav .nav-link {
    font-size: 1.14rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.skillcoin-navbar .navbar-nav .dropdown-toggle {
    font-size: 1.14rem;
    font-weight: 600;
}

.skillcoin-navbar .navbar-nav .badge {
    font-size: 0.88rem;
    font-weight: 700;
}

/*
 * 顶栏品牌（单行顶栏）：
 * - 与各菜单、语言、用户同一行；限宽 + 自适应字号 + 省略号，避免西/马长标题压住导航；
 * - 悬停 link 的 title 见完整文案（base.html / i18n_switch 已维护）。
 */
.skillcoin-navbar .skillcoin-navbar-brand {
    word-break: normal;
    line-height: 1.2;
    font-weight: 700;
    vertical-align: middle;
    display: inline-block;
    max-width: 100%;
}

@media (min-width: 992px) {
    /* 整行顶栏内容在视口内水平居中；container-fluid 减少两侧空白，标题更易排下一整句 */
    .skillcoin-navbar .skillcoin-navbar-inner {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center;
        column-gap: 0.75rem;
        max-width: 100%;
    }
    .skillcoin-navbar .skillcoin-navbar-brand {
        flex: 0 1 auto;
        min-width: 0;
        /* 放宽宽度、略减小预留，长语种尽量一行显示；极窄仍省略号 */
        max-width: min(50vw, calc(100vw - 26rem));
        margin-right: 0 !important;
        margin-left: 0 !important;
        padding-left: 0;
        padding-right: 0;
        padding-bottom: 0;
        border-bottom: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: center;
        /* 比导航链接明显更大，突出「SkillCoin 平台」等站点名 */
        font-size: clamp(0.92rem, 1.05vw + 0.58rem, 1.38rem);
    }
    .skillcoin-navbar #navbarNav {
        flex: 0 1 auto;
        min-width: 0;
        display: flex !important;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center;
        column-gap: 0.9rem;
        padding-top: 0;
    }
    .skillcoin-navbar #navbarNav > .navbar-nav.me-auto {
        flex: 0 0 auto;
        margin-right: 0 !important;
    }
    .skillcoin-navbar .navbar-toolbar {
        flex: 0 0 auto;
        flex-wrap: nowrap !important;
        align-items: center;
        gap: 0.75rem !important;
        margin-left: 0 !important;
    }
    .skillcoin-navbar .language-switcher-fixed {
        flex-wrap: nowrap;
        flex: 0 0 auto;
        width: auto;
        min-width: 272px;
        max-width: none;
        box-sizing: border-box;
        justify-content: space-between;
        padding: 6px 9px;
    }
    .skillcoin-navbar .language-switcher-fixed .lang-btn {
        flex: 0 0 auto;
        min-width: 52px;
        padding: 6px 6px;
        font-size: 0.92rem;
        font-weight: 700;
    }
    .skillcoin-navbar .language-switcher-fixed .lang-divider {
        margin: 0 2px;
        flex-shrink: 0;
    }
}

/* 顶栏：语言区与用户区分组留白 */
.navbar-toolbar {
    row-gap: 0.5rem !important;
}

/* Language Switcher Styles */
.language-switcher {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    padding: 6px 12px;
    backdrop-filter: blur(10px);
}

.lang-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 54px;
    text-align: center;
    white-space: nowrap;
}

.lang-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.lang-btn.active {
    color: #2563eb;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.lang-divider {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
    margin: 0 6px;
    user-select: none;
    align-self: center;
}


/* Mobile Responsive for Language Switcher */
@media (max-width: 991px) {
    .skillcoin-navbar .skillcoin-navbar-inner {
        justify-content: flex-start;
    }
    .language-switcher {
        margin: 10px 0;
        justify-content: center;
    }
    .skillcoin-navbar .navbar-nav .nav-link,
    .skillcoin-navbar .navbar-nav .dropdown-toggle {
        font-size: 1.08rem;
    }
    .skillcoin-navbar .skillcoin-navbar-brand {
        font-size: clamp(0.8rem, 3.4vw + 0.48rem, 1.18rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
        max-width: calc(100vw - 4.25rem);
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    padding: 120px 0;
    color: white;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero-title {
    font-size: clamp(1.35rem, 2.6vw + 0.85rem, 2.75rem);
    font-weight: 700;
    line-height: 1.18;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* 中文标题：中等屏以上单行显示，避免仅最后一字掉到第二行 */
@media (min-width: 768px) {
    .hero-title.hero-title--zh {
        white-space: nowrap;
        font-size: clamp(1.2rem, 1.9vw + 0.65rem, 2.45rem);
    }
}

.hero-subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.hero-buttons .btn {
    padding: 15px 40px;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.hero-buttons .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Stats Section */
.stats-section {
    background: #f8f9fa;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 40px 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 3rem;
    color: #2563eb;
    margin-bottom: 15px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 1rem;
}

/* Features Section */
.features-section {
    background: white;
}

.feature-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.feature-icon i {
    font-size: 2.5rem;
    color: white;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Navbar Customization */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Responsive */
@media (max-width: 767px) {
    .hero-title {
        font-size: clamp(1.1rem, 4.2vw + 0.5rem, 1.75rem);
    }

    .hero-title.hero-title--zh {
        white-space: normal;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-section {
        padding: 80px 0;
        min-height: auto;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Form Styling */
.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

/* Card Styling */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

/* Alert Styling */
.alert {
    border: none;
    border-radius: 10px;
}

/* Badge Styling */
.badge {
    font-weight: 500;
    padding: 0.5em 0.8em;
}

/* FAQ 智能问答弹窗 + 悬浮入口 */
.faq-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1040;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(74, 144, 217, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.faq-fab:hover {
    transform: scale(1.06);
    color: #fff;
    box-shadow: 0 8px 26px rgba(74, 144, 217, 0.55);
}
/* FAQ 聊天弹窗：加宽大视口，便于录屏阅读 */
.faq-chat-modal .faq-chat-modal-dialog.modal-dialog {
    max-width: min(960px, 98vw);
    width: min(960px, 96vw);
    margin: 1rem auto;
}
@media (min-width: 1200px) {
    .faq-chat-modal .faq-chat-modal-dialog.modal-dialog {
        max-width: min(1024px, 96vw);
    }
}
.faq-chat-modal .modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}
.faq-chat-modal-header {
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    color: #fff;
    padding: 16px 18px;
    border-bottom: none;
}
.faq-chat-modal-header .modal-title {
    color: #fff;
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.35;
}
.faq-chat-modal-close {
    filter: invert(1);
    opacity: 0.85;
}
.faq-chat-messages {
    max-height: min(520px, 68vh);
    min-height: 280px;
    overflow-y: auto;
    background: #f8f9fa;
    padding-top: 8px;
}
.faq-chat-robot {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    box-shadow: 0 4px 14px rgba(74, 144, 217, 0.35);
}
.faq-chat-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.faq-chat-row.user {
    flex-direction: row-reverse;
}
.faq-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}
.faq-chat-avatar.bot {
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    color: #fff;
}
.faq-chat-avatar.user {
    background: #e3f2fd;
    color: #357abd;
}
.faq-chat-bubble-wrap {
    max-width: 78%;
}
.faq-chat-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.faq-chat-bubble.bot {
    background: #fff;
    border: 1px solid #e0e0e0;
    color: #333;
    border-bottom-left-radius: 4px;
}
.faq-chat-bubble.user {
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.faq-chat-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}
.faq-chat-input-wrap {
    padding: 14px 16px 18px;
    background: #fff;
    border-top: 1px solid #eee;
}
.faq-human-link {
    color: #357abd;
    font-weight: 500;
}
.faq-human-link:hover {
    color: #285a9e;
    text-decoration: underline !important;
}
.faq-chat-send {
    width: 46px;
    height: 46px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    border: none;
    color: #fff;
}
.faq-chat-send:disabled {
    background: #ccc;
    opacity: 0.85;
    cursor: not-allowed;
}
.faq-typing {
    display: inline-flex;
    gap: 4px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
}
.faq-typing span {
    width: 7px;
    height: 7px;
    background: #4a90d9;
    border-radius: 50%;
    animation: faqTyping 1.2s infinite ease-in-out;
}
.faq-typing span:nth-child(2) { animation-delay: 0.15s; }
.faq-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes faqTyping {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40% { transform: translateY(-6px); opacity: 1; }
}
.modal.faq-chat-modal.fade .modal-dialog {
    transition: transform 0.28s ease-out, opacity 0.28s ease-out;
    transform: translate(0, 12px);
    opacity: 0.98;
}
.modal.faq-chat-modal.show .modal-dialog {
    transform: none;
    opacity: 1;
}
