/**
 * Giffgaff eSIM 工具 - 服务时间样式
 * 包含：服务时间提醒、时间卡片等专用样式
 */

/* ===== 服务时间提醒布局 ===== */
.service-time-alert {
    padding: 0;
    border: none;
    background: transparent;
}

/* 屏蔽 Bootstrap alert 默认样式 */
#serviceTimeAlert.alert,
#serviceTimeAlert.alert-success,
#serviceTimeAlert.alert-warning {
    --bs-alert-bg: transparent;
    --bs-alert-border-color: transparent;
    --bs-alert-color: inherit;
    background-color: transparent !important;
    border-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.service-time-grid {
    display: grid;
    grid-template-columns: 2fr 0.8fr;
    gap: var(--st-gap);
    padding: 18px;
    border-radius: var(--st-radius);
    background: linear-gradient(135deg, #fffaf0 0%, #fff8e0 100%);
    border: 1px solid rgba(255, 193, 7, 0.25);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

/* ===== 左侧内容区 ===== */
.service-time-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff3d6 60%, #fffaf0 60%);
    border: 1px solid rgba(255, 193, 7, 0.25);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    position: relative;
}

.service-time-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    width: 100%;
}

.service-time-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    gap: 8px;
    width: 100%;
    padding: 0;
}

.service-time-layout {
    display: flex;
    align-items: center;
    gap: 24px;
}

.service-time-icon-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
}

.service-time-content-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-time-title {
    font-weight: 700;
    font-size: 18px;
    color: var(--st-strong);
    letter-spacing: 0.2px;
    text-align: left;
    margin-bottom: 3px;
}

.service-time-message {
    color: #334155;
    line-height: 1.6;
    text-align: left;
    margin-top: 0;
    width: 100%;
}

/* ===== 服务时间图标 ===== */
#serviceTimeIcon {
    width: 80px;
    height: 80px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e6f6ee;
    color: #10b981;
    font-size: 36px;
    box-shadow: inset 0 0 0 2px rgba(16,185,129,0.15);
    line-height: 1;
    text-align: center;
}

#serviceTimeIcon.warning {
    background: #e6f6ee;
    color: #10b981;
    box-shadow: inset 0 0 0 2px rgba(16,185,129,0.15);
    animation: breathing-light-green var(--anim-base, 2.75s) var(--anim-ease-pulse, ease-in-out) infinite;
}

#serviceTimeIcon.success {
    background: #e6f6ee;
    color: #10b981;
    box-shadow: inset 0 0 0 2px rgba(16,185,129,0.15);
    animation: breathing-light-green var(--anim-base, 2.75s) var(--anim-ease-pulse, ease-in-out) infinite;
}

/* hover 用 filter，避免覆盖 animation 的 transform */
@media (hover: hover) {
    #serviceTimeIcon:hover {
        filter: brightness(1.06);
    }
}

.alert-warning #serviceTimeIcon {
    animation: warning-pulse var(--anim-base, 2.75s) var(--anim-ease-pulse, ease-in-out) infinite;
    background: #f8ecbb;
    color: #f59d06;
    box-shadow: inset 0 0 0 2px rgba(245,158,11,0.15);
}

.alert-success #serviceTimeIcon {
    animation: breathing-light-green var(--anim-base, 2.75s) var(--anim-ease-pulse, ease-in-out) infinite;
    background: #e0f6eb;
    color: #10b981;
    box-shadow: inset 0 0 0 2px rgba(16,185,129,0.15);
}

/* ===== 操作徽章 ===== */
.service-time-action-badge {
    padding: 10px 18px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 18px;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition:
        transform var(--transition-fast, 160ms ease),
        box-shadow var(--transition-base, 240ms ease),
        background-color var(--transition-base, 240ms ease),
        border-color var(--transition-base, 240ms ease);
    z-index: 10;
    flex-shrink: 0;
    text-align: center;
}

.service-time-action-badge.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 2px solid #16a34a;
    animation: breathing-light-green var(--anim-base, 2.75s) var(--anim-ease-pulse, ease-in-out) infinite;
}

.service-time-action-badge.warning {
    background: #fef2f2;
    color: #dc2626;
    border: 2px solid #dc2626;
    font-weight: 800;
    text-shadow: none;
    animation: breathing-light var(--anim-base, 2.75s) var(--anim-ease-pulse, ease-in-out) infinite;
}

@media (hover: hover) {
    .service-time-action-badge:hover {
        filter: brightness(1.04);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

/* ===== 时间卡片 ===== */
.current-time-card {
    display: grid;
    grid-template-columns: 64px 1fr;
    align-items: center;
    justify-items: center;
    text-align: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--st-card-radius);
    background: linear-gradient(135deg, #fffaf0 60%, #fff3d6 60%);
    box-shadow: var(--st-card-shadow);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    animation: pulse-glow var(--anim-slow, 3.25s) var(--anim-ease-pulse, ease-in-out) infinite;
}

.current-time-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0));
    pointer-events: none;
    z-index: -1;
}

.time-card-icon {
    width: 78px;
    height: 78px;
    border-radius: 18px;
    background: linear-gradient(135deg, #eaeaff, #e0e7ff);
    display: grid;
    place-items: center;
    box-shadow: inset 0 0 0 1px rgba(99,102,241,0.22);
    animation: breathing-light-purple var(--anim-base, 2.75s) var(--anim-ease-pulse, ease-in-out) infinite;
}

.time-card-icon i {
    color: var(--st-accent);
    font-size: 32px;
}

.time-card-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.time-card-label {
    font-size: 18px;
    color: var(--st-muted);
    font-weight: 700;
    letter-spacing: 0.2px;
}

.time-card-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 34px;
    font-weight: 900;
    letter-spacing: 1.2px;
    color: #0b1324;
    text-shadow: 0 1px 0 rgba(255,255,255,0.6);
    animation: time-breathe var(--anim-slow, 3.25s) var(--anim-ease-pulse, ease-in-out) infinite;
}

.time-card-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

/* 服务时间：暗色模式 */
@media (prefers-color-scheme: dark) {
    .service-time-grid {
        background: linear-gradient(135deg, #2a2418 0%, #1f1b14 100%);
        border-color: rgba(255, 193, 7, 0.22);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    }

    .service-time-left {
        background: linear-gradient(135deg, #322b1c 60%, #241f16 60%);
        border-color: rgba(255, 193, 7, 0.2);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    }

    .service-time-title {
        color: #f8fafc;
    }

    .service-time-message {
        color: #cbd5e1;
    }

    .current-time-card {
        background: linear-gradient(135deg, #2a2418 60%, #322b1c 60%);
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
    }

    .current-time-card::after {
        background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0));
    }

    .time-card-value {
        color: #f8fafc;
        text-shadow: none;
    }

    .time-card-hint {
        color: #94a3b8;
    }

    #serviceTimeIcon {
        background: rgba(16, 185, 129, 0.15);
        color: #34d399;
        box-shadow: inset 0 0 0 2px rgba(16, 185, 129, 0.25);
    }

    .alert-warning #serviceTimeIcon,
    #serviceTimeIcon.warning {
        background: rgba(245, 158, 11, 0.18);
        color: #fbbf24;
        box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.28);
    }

    .service-time-action-badge.success {
        background: rgba(22, 163, 74, 0.15);
        color: #4ade80;
        border-color: #16a34a;
    }

    .service-time-action-badge.warning {
        background: rgba(220, 38, 38, 0.15);
        color: #f87171;
        border-color: #dc2626;
    }

    .time-card-icon {
        background: linear-gradient(135deg, #1e1b2e, #252038);
        box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.28);
    }
}

/* 尊重减少动态偏好 */
@media (prefers-reduced-motion: reduce) {
    #serviceTimeIcon.warning,
    #serviceTimeIcon.success,
    .alert-warning #serviceTimeIcon,
    .alert-success #serviceTimeIcon,
    .service-time-action-badge.warning,
    .service-time-action-badge.success,
    .current-time-card,
    .time-card-icon,
    .time-card-value {
        animation: none !important;
    }
}