/* Musa NPSourcing多语言运费计算器 - 样式文件 */

/* 字体导入 - 支持多语言 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@300;400;500;600;700&display=swap');

/* 基础样式重置 */
* {
    box-sizing: border-box;
}

/* 根据语言设置字体 */
html[lang="en"] {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html[lang="zh"] {
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
}

html[lang="np"] {
    font-family: 'Noto Sans Devanagari', 'Inter', Devanagari, sans-serif;
}

/* 多语言文本方向支持 */
[dir="rtl"] {
    text-align: right;
}

[dir="ltr"] {
    text-align: left;
}

/* 自定义动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

@keyframes shine {
    0% { 
        left: -100%; 
    }
    100% { 
        left: 100%; 
    }
}

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

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 页面加载动画 */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

/* 渐变背景 */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-text {
    background: linear-gradient(135deg, #2563eb, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 卡片阴影效果 */
.card-shadow {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.card-shadow:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* 语言切换器样式 */
.language-switcher {
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.language-switcher:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.language-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    color: #ffffff;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px) scale(1.05);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #ffffff;
}

/* 确保激活状态的橙黄色在悬停时也保持 */
.language-btn.active:hover {
    color: #FF8C00 !important;
}

.language-btn.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.3));
    color: #FF8C00 !important;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), inset 0 1px 3px rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.language-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s;
    z-index: 1;
}

.language-btn:hover::before {
    left: 100%;
}

.language-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 6px;
    z-index: 0;
}

.language-btn.active::after {
    opacity: 1;
}

/* 确保按钮文字显示在前景 */
.language-btn span,
.language-btn {
    position: relative;
    z-index: 2;
}

/* 为移动端按钮添加选中状态识别（已合并到下方样式中） */

/* 移动端语言菜单 */
#languageMenu {
    backdrop-filter: blur(20px);
    border: 2px solid rgba(0, 0, 0, 0.15);
    animation: fadeInUp 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.mobile-lang-btn {
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 2px;
    border: 1px solid transparent;
    color: #6b7280;
}

.mobile-lang-btn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white !important;
    transform: translateX(5px) scale(1.02);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.mobile-lang-btn:active,
.mobile-lang-btn.selected,
.mobile-lang-btn.current {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    color: #FF8C00 !important;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 按钮悬停效果 */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-hover-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-hover-effect::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;
}

.btn-hover-effect:hover::before {
    left: 100%;
}

/* 输入框聚焦效果 */
.input-focus {
    transition: all 0.3s ease;
}

.input-focus:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 结果卡片样式 */
.result-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    overflow: hidden;
}

.result-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.best-price {
    position: relative;
    overflow: hidden;
    animation: pulse 2s infinite;
}

.best-price::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shine 3s infinite;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* 渐变过渡效果 */
.fade-transition {
    transition: opacity 0.3s ease;
}

/* 多语言文本对齐 */
html[lang="np"] .text-center {
    text-align: center;
}

html[lang="np"] .text-right {
    text-align: right;
}

html[lang="np"] .text-left {
    text-align: left;
}

/* 特殊语言字体优化 */
html[lang="np"] .text-xl {
    font-size: 1.15rem;
    line-height: 1.6;
}

html[lang="np"] .text-2xl {
    font-size: 1.4rem;
    line-height: 1.5;
}

html[lang="np"] .text-3xl {
    font-size: 1.8rem;
    line-height: 1.4;
}

/* 响应式设计优化 */
@media (max-width: 768px) {
    .language-switcher {
        display: none;
    }
    
    .gradient-bg .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-shadow {
        margin: 0.5rem;
        border-radius: 8px;
    }
    
    .result-card {
        margin-bottom: 1rem;
        padding: 1rem !important;
    }
    
    /* 移动端结果卡片优化 */
    .result-card .flex.items-center.justify-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .result-card .text-right {
        text-align: left !important;
        width: 100%;
        margin-top: 0.5rem;
    }
    
    /* 移动端价格显示优化 */
    .result-card .text-3xl {
        font-size: 1.75rem !important;
        line-height: 1.2;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    .result-card .text-xl {
        font-size: 1.1rem !important;
        line-height: 1.3;
    }
    
    /* 移动端图标和文字布局 */
    .result-card .flex.items-center:first-child {
        width: 100%;
    }
    
    .result-card .bg-green-100,
    .result-card .bg-blue-100,
    .result-card .bg-orange-100,
    .result-card .bg-red-100 {
        padding: 0.5rem !important;
        margin-right: 0.75rem !important;
    }
    
    /* 移动端网格布局优化 */
    .result-card .grid.grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .result-card .grid.grid-cols-2 > div {
        margin-bottom: 0.25rem;
    }
    
    /* 移动端按钮优化 */
    .result-card button {
        font-size: 0.9rem !important;
        padding: 0.75rem 1rem !important;
    }
    
    /* 移动端最优选择标签优化 */
    .result-card .flex.justify-between.items-center {
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .result-card .bg-green-500 {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    /* 移动端文字大小调整 */
    html[lang="np"] .text-sm {
        font-size: 0.8rem;
    }
    
    html[lang="np"] .text-base {
        font-size: 0.9rem;
    }
    
    html[lang="np"] .result-card .text-xl {
        font-size: 1rem !important;
    }
    
    html[lang="np"] .result-card .text-3xl {
        font-size: 1.5rem !important;
    }
    
    /* 计算器输入区域移动端优化 */
    .calculator-inputs {
        padding: 1rem !important;
    }
    
    .calculator-inputs .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    /* 确保所有文本内容不被截断 */
    .result-card * {
        max-width: 100%;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }
    
    /* 价格数字特殊处理 - 防止截断 */
    .result-card .font-bold[class*="text-"] {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0.25rem;
        min-width: 0;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    /* 价格容器确保足够空间 */
    .result-card .text-right {
        min-width: 120px;
        flex-shrink: 0;
    }
    
    /* 单位文字调整 */
    .result-card .text-lg {
        font-size: 1rem !important;
        font-weight: 500;
        white-space: nowrap;
    }
    
    /* 服务特色移动端优化 */
    .features-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    /* 路线展示移动端优化 */
    .route-cards {
        flex-direction: column !important;
        gap: 1rem;
    }
    
    /* 联系信息移动端优化 */
    .contact-info .grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    
    /* 页脚移动端优化 */
    .footer-content {
        flex-direction: column !important;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-section {
        margin-bottom: 1rem;
    }
    
    .qr-codes {
        justify-content: center !important;
        gap: 1rem;
    }
}

/* 超小屏幕额外优化 */
@media (max-width: 480px) {
    .result-card {
        padding: 0.75rem !important;
    }
    
    .result-card .text-3xl {
        font-size: 1.5rem !important;
    }
    
    .result-card .text-xl {
        font-size: 1rem !important;
    }
    
    /* 确保价格数字完全可见 */
    .result-card .text-right {
        min-width: 100px;
        overflow: visible;
    }
    
    /* 超小屏幕的价格显示 */
    .result-card .font-bold {
        line-height: 1.1;
        letter-spacing: -0.025em;
    }
}

/* 数字显示优化 */
.number-display {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* 货币显示样式 */
.currency-display {
    font-weight: 700;
    color: #059669;
}

/* 成功状态样式 */
.success-state {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

/* 警告状态样式 */
.warning-state {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

/* 错误状态样式 */
.error-state {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* 信息状态样式 */
.info-state {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

/* 高亮效果 */
.highlight {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.1));
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.highlight:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.2));
    border-color: rgba(59, 130, 246, 0.5);
}

/* 无障碍优化 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .card-shadow {
        border: 2px solid #000;
    }
    
    .language-btn {
        border: 1px solid #000;
    }
    
    .gradient-bg {
        background: #000;
        color: #fff;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .bg-white {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .text-gray-800 {
        color: #f9fafb;
    }
    
    .text-gray-600 {
        color: #d1d5db;
    }
    
    .text-gray-500 {
        color: #9ca3af;
    }
    
    .border-gray-300 {
        border-color: #4b5563;
    }
    
    .bg-gray-50 {
        background-color: #111827;
    }
}

/* 打印样式 */
@media print {
    .language-switcher,
    .btn-hover-effect,
    .card-shadow {
        display: none;
    }
    
    .gradient-bg {
        background: #fff;
        color: #000;
    }
    
    .result-card {
        border: 1px solid #000;
        margin-bottom: 1rem;
        break-inside: avoid;
    }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

/* 工具提示样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translate(-50%, -50%) scale(1);
}

/* 精准水印隐藏 - 安全版 */
/* 只隐藏明确的水印元素 */
[class*="minimax-watermark"],
[class*="agent-watermark"],
[class*="creator-badge"],
[id*="minimax-watermark"],
[id*="agent-watermark"],
[data-watermark="minimax"],
[data-watermark="agent"],
.minimax-watermark,
.agent-watermark,
.creator-badge {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    z-index: -9999 !important;
}

/* 隐藏水印iframe */
iframe[src*="minimax.space/watermark"],
iframe[src*="agent-watermark"] {
    display: none !important;
}
