/**
 * Giffgaff eSIM 工具 - 组件样式
 * 包含：头部、按钮、步骤指示器、状态显示等组件
 */

/* ===== 应用头部 ===== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-container {
    display: flex;
    align-items: center;
}

.app-icon {
    font-size: 24px;
    margin-right: 10px;
    color: #ffcc00;
}

.app-title {
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(to right, #ffcc00, #4361ee);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ===== 按钮样式 ===== */
.login-btn {
    background: linear-gradient(to right, #ffcc00, #ffffff);
    border: none;
    font-size: 16px;
    color: #212529;
    cursor: pointer;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 30px;
    transition:
        transform var(--transition-fast, 160ms ease),
        box-shadow var(--transition-fast, 160ms ease),
        border-color var(--transition-base, 240ms ease),
        background var(--transition-base, 240ms ease);
    gap: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    border: 1px solid rgba(255, 204, 0, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

@media (hover: hover) {
    .login-btn:hover {
        background: linear-gradient(to right, #ffffff, #ffcc00);
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
        border-color: rgba(255, 204, 0, 0.5);
    }
}

.github-btn {
    background: linear-gradient(to right, #333333, #666666);
    border: none;
    font-size: 16px;
    color: #ffffff;
    cursor: pointer;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 30px;
    transition:
        transform var(--transition-fast, 160ms ease),
        box-shadow var(--transition-fast, 160ms ease),
        border-color var(--transition-base, 240ms ease),
        background var(--transition-base, 240ms ease),
        color var(--transition-fast, 160ms ease);
    gap: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    border: 1px solid rgba(51, 51, 51, 0.3);
    margin-left: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (hover: hover) {
    .github-btn:hover {
        background: linear-gradient(to right, #666666, #333333);
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
        border-color: rgba(51, 51, 51, 0.5);
        color: #ffffff;
    }
}

.btn-group {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.btn {
    padding: 16px 25px;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition:
        transform var(--transition-fast, 160ms ease),
        box-shadow var(--transition-fast, 160ms ease),
        background var(--transition-base, 240ms ease),
        opacity var(--transition-fast, 160ms ease);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
}

.btn-primary {
    background: linear-gradient(to right, #ffcc00, #ffffff);
    color: #212529;
}

@media (hover: hover) {
    .btn-primary:hover {
        background: linear-gradient(to right, #ffffff, #ffcc00);
        transform: translateY(-2px);
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.12);
    }
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.clear-session-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition:
        transform var(--transition-fast, 160ms ease),
        box-shadow var(--transition-fast, 160ms ease),
        background var(--transition-base, 240ms ease);
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (hover: hover) {
    .clear-session-btn:hover {
        background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
        transform: translateY(-1px);
    }
}

/* ===== 页面标题 ===== */
.page-title {
    text-align: center;
    margin: 30px 0 40px;
}

.page-title h1 {
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
    color: #212529;
}

.page-title p {
    color: rgba(33, 37, 41, 0.7);
    font-size: 18px;
    margin-top: 8px;
}

/* ===== 提示框列表间距 ===== */
.alert.alert-warning ol,
.alert.alert-warning ul {
    padding-left: 1rem;
    margin-left: 0;
    list-style-position: inside;
}

.alert.alert-warning li {
    padding-left: 0.35rem;
}

.alert.alert-warning ol li::marker {
    content: counter(list-item) ".\00A0\00A0";
}

/* ===== 步骤指示器（进度轨见 design-system） ===== */
/* 背景与页面卡片统一：暖奶油/橘黄，避免冷灰白 */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin: 0 auto 40px;
    position: relative;
    max-width: 820px;
    counter-reset: step;
    padding: 16px 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fffdf7 0%, #fff8e6 55%, #fff3d6 100%);
    border: 1px solid rgba(255, 204, 0, 0.3);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    width: 120px;
    position: relative;
    transition: opacity var(--transition-fast, 160ms ease);
}

.step-number {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fffdf7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 20px;
    color: #212529;
    border: 2px solid rgba(255, 193, 7, 0.55);
    box-shadow: inset 0 0 0 2px rgba(255, 193, 7, 0.18);
    transition:
        background var(--transition-base, 240ms ease),
        border-color var(--transition-base, 240ms ease),
        box-shadow var(--transition-base, 240ms ease),
        color var(--transition-base, 240ms ease),
        transform var(--transition-fast, 160ms ease);
}

.step.completed .step-number {
    background: linear-gradient(135deg, #f0c000, #e6b800);
    color: #212529;
    border-color: rgba(230, 184, 0, 0.9);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.35);
}

.step.completed .step-text {
    color: #854d0e;
    font-weight: 600;
}

.step.active .step-number {
    background: linear-gradient(135deg, #ffcc00, #ffd84d);
    color: #212529;
    border-color: rgba(255, 193, 7, 0.85);
    /* 静态阴影交给 pulse-ring 动画；颜色用高对比琥珀，避免黄底上看不见 */
    --step-pulse-color: rgba(180, 83, 9, 0.75);
    animation: pulse-ring var(--anim-base, 2.75s) var(--anim-ease-pulse, cubic-bezier(0.4, 0, 0.6, 1)) infinite;
}

.step.active .step-text {
    color: #713f12;
    font-weight: 700;
}

.step-text {
    font-size: 14px;
    text-align: center;
    color: #6b5a2e;
    font-weight: 500;
    transition: color var(--transition-fast, 160ms ease);
}

/* ===== 状态显示 ===== */
.status {
    margin-top: 25px;
    padding: 18px 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    font-size: 16px;
    border-left: 4px solid transparent;
    color: #212529;
}

.status.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

.status.success {
    border-left: 4px solid var(--primary);
}

.status.error {
    border-left: 4px solid var(--warning);
}

.status.info {
    border-left: 4px solid var(--success);
}

/* ===== 状态网格 ===== */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    min-height: 40px;
}

.status-label {
    font-weight: 500;
    color: #6c757d;
    min-width: 100px;
    flex-shrink: 0;
    margin-right: 12px;
}

.status-value {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #495057;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    cursor: default;
    position: relative;
    text-align: right;
}

.status-value:hover {
    background-color: rgba(255, 204, 0, 0.1);
    border-radius: 4px;
}

.status-value.connected {
    color: #28a745;
    font-weight: 500;
}

.status-value.disconnected {
    color: #dc3545;
    font-weight: 500;
}

/* ===== 模式徽标 ===== */
.mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #7c2d12;
    background: linear-gradient(135deg, #fff7d6, #ffe9a6);
    border: 1px solid #ffd24d;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* ===== 新用户提示 ===== */
.new-user-notice {
    background: linear-gradient(135deg, #fef2f2, #fce7e7);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #7f1d1d;
    text-align: center;
    line-height: 1.6;
}

.new-user-notice .notice-line1 {
    display: block;
    font-weight: 600;
}

.new-user-notice .notice-line1 i {
    color: #dc2626;
    margin-right: 4px;
}

.new-user-notice .notice-line2 {
    display: block;
}

/* ===== 推广横幅 ===== */
.promo-banner {
    background: linear-gradient(135deg, #ffcc00, #ffd633);
    border-radius: 12px;
    margin: 20px 0;
    padding: 16px 20px;
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.3);
    animation: subtle-pulse var(--anim-slow, 3.25s) var(--anim-ease-pulse, ease-in-out) infinite;
}

.promo-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
}

.promo-icon {
    color: #212529;
    font-size: 20px;
    animation: bounce var(--anim-fast, 2s) var(--anim-ease-pulse, ease-in-out) infinite;
}

/* 悬停时暂停装饰动画，阅读更稳 */
@media (hover: hover) {
    .promo-banner:hover,
    .promo-banner:hover .promo-icon {
        animation-play-state: paused;
    }
}

.promo-text {
    color: #212529;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

.promo-link {
    color: #212529;
    text-decoration: underline;
    font-weight: 600;
    transition: color var(--transition-fast, 160ms ease), text-shadow var(--transition-fast, 160ms ease);
}

.promo-link:hover {
    color: #000;
    text-decoration: none;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

/* ===== 章节控制：进入时淡入上移 ===== */
.section {
    display: none;
}

.section.active {
    display: block;
    animation: section-enter 0.35s var(--ease-out, cubic-bezier(.2, .8, .2, 1)) both;
}

.verification-section {
    margin-top: 25px;
    display: none;
}

.verification-section.active {
    display: block;
    animation: section-enter 0.35s var(--ease-out, cubic-bezier(.2, .8, .2, 1)) both;
}

@media (prefers-reduced-motion: reduce) {
    .section.active,
    .verification-section.active {
        animation: none !important;
    }
}

/* ===== 表单标签 ===== */
.form-label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 17px;
    color: #212529;
}

/* ===== Tooltip提示框 ===== */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    max-width: 400px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip.show {
    opacity: 1;
}

.qrcode-container {
    position: relative;
    display: inline-block;
    cursor: help;
}

.qrcode-container:hover .tooltip {
    opacity: 1;
}

/* ===== 加载指示器 ===== */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 1s ease-in-out infinite;
}

/* ===== Toast通知 ===== */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 16px;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.toast-notification.show {
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
}

.toast-content i {
    color: #4cc9f0;
    font-size: 18px;
}

/* ===== 网络状态指示器 ===== */
.network-status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.network-status.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.network-status.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.network-status.show {
    transform: translateX(0);
}

/* ===== 更新通知 ===== */
.update-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
    z-index: 10000;
    max-width: 300px;
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== 加载内容 ===== */
.loading-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.loading-content p {
    margin: 0;
    color: #6b7280;
    font-weight: 500;
}

/* ===== 徽章样式 ===== */
.badge-pill-cta {
    font-size: 1.15rem;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    letter-spacing: 1px;
    display: inline-block;
    line-height: 1;
}

.badge-spacer {
    margin-top: 0.75rem;
}

/* ===== 触摸反馈 ===== */
.touch-active {
    transform: scale(0.98) !important;
    transition: transform 0.1s ease !important;
}

/* ===== 结果容器 ===== */
#resultContainer {
    display: none;
}

#resultContainer.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

/* ===== 暗色模式：组件层 ===== */
@media (prefers-color-scheme: dark) {
    .page-title h1 {
        color: #f8fafc;
    }

    .page-title p {
        color: rgba(233, 236, 239, 0.72);
    }

    .step-indicator {
        background: linear-gradient(135deg, #2a2418 0%, #322b1c 55%, #3a2f1a 100%);
        border-color: rgba(255, 204, 0, 0.22);
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.35);
    }

    .step-number {
        background: #2a2618;
        color: #f8fafc;
        border-color: rgba(255, 193, 7, 0.45);
        box-shadow: inset 0 0 0 2px rgba(255, 193, 7, 0.12);
    }

    .step-text {
        color: #d6c48a;
    }

    .step.completed .step-text {
        color: #fde68a;
    }

    .step.active .step-text {
        color: #fef3c7;
    }

    .status {
        background: rgba(30, 30, 30, 0.92);
        color: #e9ecef;
    }

    .status-item {
        background: rgba(42, 42, 42, 0.9);
        border-color: rgba(255, 255, 255, 0.08);
    }

    .status-label {
        color: #adb5bd;
    }

    .status-value {
        color: #d0d0d0;
    }

    .form-label {
        color: #e9ecef;
    }

    .new-user-notice {
        background: linear-gradient(135deg, rgba(127, 29, 29, 0.35), rgba(69, 10, 10, 0.45));
        border-color: rgba(248, 113, 113, 0.35);
        color: #fecaca;
    }

    .promo-banner {
        box-shadow: 0 4px 18px rgba(255, 204, 0, 0.18);
    }

    .login-btn {
        color: #111;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    }
}

@media (prefers-reduced-motion: reduce) {
    .promo-banner,
    .promo-icon {
        animation: none !important;
    }
}
