/****************************************************
* Trial System Styles
* 5분 무료 체험 타이머 및 모달 스타일
****************************************************/

/* ==================== 타이머 배지 ==================== */
.trial-timer-badge {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    z-index: 1000;
    animation: pulse 2s infinite;
    user-select: none;
}

.trial-timer-badge i {
    font-size: 1.2rem;
}

/* 펄스 애니메이션 */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ==================== 체험 종료 모달 ==================== */
.trial-expired-modal {
    z-index: 10000;
}

.trial-expired-modal .modal-content {
    animation: modalBounce 0.5s ease-out;
}

/* ==================== ⭐ 환영 모달 (신규) ==================== */
.trial-welcome-modal {
    z-index: 10000;
}

.trial-welcome-modal .modal-content {
    animation: modalBounce 0.5s ease-out;
    max-width: 500px;
}

.trial-welcome-modal .modal-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

.trial-welcome-modal .modal-body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 1.5rem;
    border-radius: 8px;
}

.trial-welcome-modal .modal-body ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.trial-welcome-modal .modal-body ul li {
    padding: 0.5rem 0;
    font-size: 1rem;
}

.trial-welcome-modal .modal-body p strong {
    color: var(--color-primary, #667eea);
    font-weight: 700;
}

@keyframes modalBounce {
    0% {
        transform: scale(0.3) translateY(-100%);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==================== 경고 색상 (1분 이하) ==================== */
.trial-timer-badge.warning {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    animation: pulseWarning 1s infinite;
}

@keyframes pulseWarning {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(255, 68, 68, 0.6);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 6px 16px rgba(255, 68, 68, 0.8);
    }
}

/* ==================== 모바일 대응 ==================== */
@media (max-width: 768px) {
    .trial-timer-badge {
        top: auto;
        bottom: 5rem; /* 하단 네비 위 */
        right: 1rem;
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .trial-timer-badge i {
        font-size: 1rem;
    }
}

/* ==================== 다크모드 대응 ==================== */
[data-theme="dark"] .trial-timer-badge {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

[data-theme="dark"] .trial-timer-badge.warning {
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.7);
}

/* ==================== 체험 모달 커스텀 ==================== */
.trial-expired-modal .modal-body,
.trial-welcome-modal .modal-body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

[data-theme="dark"] .trial-expired-modal .modal-body,
[data-theme="dark"] .trial-welcome-modal .modal-body {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

/* ==================== 버튼 스타일 ==================== */
.trial-expired-modal .btn-primary,
.trial-welcome-modal .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
}

.trial-expired-modal .btn-primary:hover,
.trial-welcome-modal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.trial-expired-modal .btn-primary:active,
.trial-welcome-modal .btn-primary:active {
    transform: translateY(0);
}

/* ==================== 타이머 숫자 강조 ==================== */
.trial-timer-badge #trial-timer {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* ==================== 접근성 ==================== */
.trial-timer-badge:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* ==================== 인쇄 시 숨김 ==================== */
@media print {
    .trial-timer-badge {
        display: none !important;
    }
}

/* ========================================
   Trial Modal Close Button (X)
   ======================================== */
.trial-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary, #666);
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.trial-modal-close:hover {
    background: var(--surface-secondary, rgba(0, 0, 0, 0.05));
    color: var(--text-primary, #333);
    transform: rotate(90deg);
}

.trial-modal-close:active {
    transform: rotate(90deg) scale(0.9);
}
