/**
 * PC端签到弹窗样式 - 698x450 横向布局
 *
 * @package HiTemp
 * @since 1.0.0
 */

/* ===== 签到弹窗 ===== */
.checkin-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.checkin-modal.show {
    opacity: 1;
    visibility: visible;
}

.checkin-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.checkin-modal-content {
    position: relative;
    width: 698px;
    height: 450px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.checkin-modal.show .checkin-modal-content {
    transform: scale(1) translateY(0);
}

/* 弹窗头部 */
.checkin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.checkin-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.checkin-header-info {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkin-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.checkin-modal-header p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    margin: 4px 0 0;
}

.checkin-modal-close {
    position: relative;
    z-index: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.checkin-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* 弹窗内容 - 左右分栏 */
.checkin-modal-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 左侧区域 */
.checkin-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid #e5e7eb;
}

/* 右侧区域 - 日历 */
.checkin-right {
    width: 280px;
    flex-shrink: 0;
    padding: 20px;
    background: #f8fafc;
    overflow-y: auto;
}

/* 签到统计 + 按钮区域 */
.checkin-top-area {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}

.checkin-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 12px;
    flex: 1;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #16a34a;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    height: 36px;
    background: #bbf7d0;
}

/* 签到按钮 */
.checkin-action {
    flex-shrink: 0;
}

.btn-checkin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
    white-space: nowrap;
}

.btn-checkin:hover:not(:disabled) {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.5);
}

.btn-checkin.checked {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    box-shadow: none;
    cursor: default;
}

.btn-checkin.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-checkin.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 签到奖励 */
.checkin-rewards {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.rewards-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 10px;
    flex-shrink: 0;
}

.rewards-title i {
    color: #f59e0b;
    font-size: 15px;
}

.rewards-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
    flex-shrink: 0;
}

.reward-item:hover {
    border-color: #cbd5e1;
}

.reward-item.can-claim {
    border-color: #22c55e;
    background: linear-gradient(135deg, #f0fdf4, #fff);
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.15);
}

.reward-item.claimed {
    background: #f8fafc;
    opacity: 0.7;
}

.reward-item.no-stock {
    background: #fef2f2;
    border-color: #fecaca;
}

.reward-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #e2e8f0;
}

.reward-progress .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 0 2px 2px 0;
    transition: width 0.5s ease;
}

.reward-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.reward-day {
    flex-shrink: 0;
    text-align: center;
    min-width: 38px;
}

.reward-day .day-num {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: #22c55e;
    line-height: 1;
}

.reward-day .day-text {
    font-size: 11px;
    color: #64748b;
}

.reward-coupon {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.reward-coupon .coupon-value {
    display: inline-block;
    padding: 2px 6px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    flex-shrink: 0;
}

.reward-coupon .coupon-name {
    font-size: 13px;
    color: #1e293b;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reward-action {
    flex-shrink: 0;
}

.reward-status {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.reward-status.claimed {
    color: #22c55e;
}

.reward-status.claimed i {
    font-size: 13px;
}

.reward-status.no-stock {
    color: #ef4444;
}

.reward-status.pending .days-left {
    font-weight: 700;
    color: #f59e0b;
}

.btn-claim-reward {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-claim-reward:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4);
}

.btn-claim-reward.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* 装饰性优惠券卡片 */
.coupon-decoration {
    padding: 0;
    margin-top: -2px;
    flex-shrink: 0;
}

.coupon-card-deco {
    display: flex;
    width: 100%;
    background: linear-gradient(135deg, #fff9e6 0%, #fff 100%);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
    border: 1px dashed #fbbf24;
    position: relative;
}

.coupon-card-deco::before,
.coupon-card-deco::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #f8fafc;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.coupon-card-deco::before {
    left: -8px;
    border-right: 1px dashed #fbbf24;
}

.coupon-card-deco::after {
    right: -8px;
    border-left: 1px dashed #fbbf24;
}

.coupon-card-left-deco {
    width: 90px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    position: relative;
}

.coupon-card-left-deco::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10px;
    bottom: 10px;
    width: 1px;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 4px,
        rgba(255,255,255,0.3) 4px,
        rgba(255,255,255,0.3) 8px
    );
}

.coupon-amount {
    display: flex;
    align-items: baseline;
    line-height: 1;
}

.coupon-amount .amount-symbol {
    font-size: 16px;
    font-weight: 600;
}

.coupon-amount .amount-num {
    font-size: 36px;
    font-weight: 800;
}

.coupon-type-text {
    font-size: 11px;
    margin-top: 6px;
    opacity: 0.9;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

.coupon-card-right-deco {
    flex: 1;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.coupon-card-right-deco .coupon-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coupon-card-right-deco .coupon-desc {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

.coupon-card-right-deco .coupon-tip {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #f59e0b;
}

.coupon-card-right-deco .coupon-tip i {
    font-size: 10px;
}

/* 优惠券库存/兑换码显示区 */
.coupon-card-stock {
    min-width: 80px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.08);
    border-left: 1px dashed #fbbf24;
}

.stock-display,
.code-display {
    text-align: center;
}

.stock-label,
.code-label {
    font-size: 10px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.stock-num {
    font-size: 24px;
    font-weight: 700;
    color: #f59e0b;
    line-height: 1;
}

.code-value {
    font-size: 12px;
    font-weight: 600;
    color: #10b981;
    font-family: 'Consolas', 'Monaco', monospace;
    word-break: break-all;
    line-height: 1.3;
}

/* 签到轮播 - 在 coupon-name 位置 */
.coupon-marquee {
    flex: 1;
    height: 18px;
    overflow: hidden;
    position: relative;
    min-width: 0;
}

.coupon-marquee .marquee-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 18px;
    line-height: 18px;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.4s ease;
}

.coupon-marquee .marquee-item.active {
    opacity: 1;
    transform: translateY(0);
}

/* 签到日历 */
.checkin-calendar {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.calendar-header {
    margin-bottom: 12px;
    flex-shrink: 0;
}

.calendar-header h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.calendar-header h4 i {
    color: #3b82f6;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    padding: 4px 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    flex: 1;
    align-content: start;
}

.day-cell {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #374151;
    background: #fff;
    border-radius: 6px;
    transition: all 0.2s;
}

.day-cell.empty {
    background: transparent;
}

.day-cell.today {
    font-weight: 700;
    color: #22c55e;
    border: 2px solid #22c55e;
}

.day-cell.checked {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    font-weight: 600;
}

.day-cell.checked i {
    position: absolute;
    bottom: 1px;
    right: 1px;
    font-size: 6px;
    opacity: 0.8;
}

.day-cell.future {
    color: #cbd5e1;
}

/* 签到成功动画 */
.checkin-success-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px 40px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    animation: successIn 0.4s ease-out;
}

@keyframes successIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.checkin-success-animation .success-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkin-success-animation .success-icon i {
    font-size: 28px;
    color: #fff;
    animation: iconBounce 0.5s ease-out 0.2s both;
}

@keyframes iconBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.checkin-success-animation .success-text {
    font-size: 16px;
    font-weight: 700;
    color: #16a34a;
}

.checkin-success-animation .success-days {
    font-size: 13px;
    color: #64748b;
}

.checkin-success-animation .success-days span {
    font-weight: 700;
    color: #f59e0b;
}

/* Toast 提示 */
.checkin-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100001;
    padding: 16px 28px;
    background: #fff;
    font-size: 15px;
    font-weight: 500;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: checkinToastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.checkin-toast.success {
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.checkin-toast.error {
    border: 1px solid #fecaca;
    color: #dc2626;
}

@keyframes checkinToastIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 弹窗打开时禁止滚动 */
body.checkin-modal-open {
    overflow: hidden;
}

/* 响应式 - 小屏幕回退到单列布局 */
@media (max-width: 720px) {
    .checkin-modal-content {
        width: 95%;
        max-width: 460px;
        height: auto;
        max-height: 90vh;
    }
    
    .checkin-modal-body {
        flex-direction: column;
    }
    
    .checkin-left {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .checkin-right {
        width: 100%;
        max-height: 200px;
    }
    
    .checkin-top-area {
        flex-direction: column;
        align-items: stretch;
    }
    
    .checkin-stats {
        justify-content: center;
    }
    
    .checkin-action {
        text-align: center;
    }
}
