/**
 * 포인트 시스템 UI 스타일
 * 포인트 모달, 토스트, 알림 등의 스타일 정의
 * 작성일: 2025-09-18
 */

/* ===============================================
   포인트 모달 기본 스타일
   =============================================== */
.points-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.points-modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.points-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.points-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.points-modal-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s;
}

.points-modal-close:hover {
    color: white;
}

.points-modal-body {
    padding: 24px;
    color: #333;
}

.points-modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ===============================================
   포인트 부족 모달 스타일
   =============================================== */
.insufficient-points-content {
    text-align: center;
}

.points-info {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
}

.points-info > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.points-info .label {
    font-weight: 500;
    color: #6c757d;
}

.points-info .amount {
    font-weight: 600;
    font-size: 16px;
}

.amount.needed {
    color: #fd7e14;
}

.amount.shortage {
    color: #dc3545;
}

.action-message {
    margin: 16px 0;
    font-size: 16px;
    color: #495057;
}

.solution-options {
    background: #e7f3ff;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    text-align: left;
}

.solution-options p {
    margin: 0 0 8px;
    font-weight: 500;
    color: #0056b3;
}

.solution-options ul {
    margin: 0;
    padding-left: 20px;
}

.solution-options li {
    margin: 4px 0;
    color: #495057;
}

/* ===============================================
   일일 보상 모달 스타일
   =============================================== */
.daily-reward-modal {
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.daily-reward-modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4);
    max-width: 400px;
    width: 90%;
    animation: rewardBounceIn 0.6s ease-out;
}

@keyframes rewardBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) rotateY(180deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) rotateY(0deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

.daily-reward-header {
    padding: 32px 24px 24px;
}

.reward-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: giftShake 2s ease-in-out infinite;
}

@keyframes giftShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.daily-reward-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.daily-reward-body {
    padding: 0 24px 24px;
}

.reward-points {
    margin: 24px 0;
}

.points-amount {
    font-size: 36px;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.points-label {
    display: block;
    font-size: 16px;
    margin-top: 8px;
    opacity: 0.9;
}

.total-points {
    font-size: 16px;
    margin: 16px 0;
    opacity: 0.9;
}

.reward-message {
    font-size: 14px;
    opacity: 0.8;
    margin: 16px 0;
}

.daily-reward-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.auto-close-info {
    font-size: 12px;
    opacity: 0.8;
}

/* ===============================================
   확인 모달 스타일
   =============================================== */
.confirm-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    animation: modalSlideIn 0.3s ease-out;
}

.confirm-modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e9ecef;
}

.confirm-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.confirm-modal-body {
    padding: 24px;
}

.confirm-modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.stock-view-confirm,
.file-download-confirm {
    text-align: center;
}

.confirm-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: #667eea;
}

.confirm-message p {
    margin: 0 0 16px;
    font-size: 16px;
    color: #495057;
}

.stock-code,
.fileset-id {
    display: inline-block;
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    margin: 8px 0;
}

.points-deduction {
    margin: 16px 0;
    padding: 12px;
    background: #fff3cd;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
}

.deduction-amount {
    font-weight: 600;
    color: #856404;
}

/* ===============================================
   토스트 알림 스타일
   =============================================== */
.points-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10002;
    max-width: 400px;
    animation: toastSlideIn 0.3s ease-out;
}

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

.points-toast-content {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid #667eea;
}

.points-toast.success .points-toast-content {
    border-left-color: #28a745;
}

.points-toast.error .points-toast-content {
    border-left-color: #dc3545;
}

.points-toast.info .points-toast-content {
    border-left-color: #17a2b8;
}

.points-toast-icon {
    font-size: 20px;
    color: #667eea;
}

.points-toast.success .points-toast-icon {
    color: #28a745;
}

.points-toast.error .points-toast-icon {
    color: #dc3545;
}

.points-toast.info .points-toast-icon {
    color: #17a2b8;
}

.points-toast-message {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.points-toast-close {
    cursor: pointer;
    color: #6c757d;
    font-size: 14px;
    padding: 4px;
}

.points-toast-close:hover {
    color: #333;
}

/* ===============================================
   버튼 스타일
   =============================================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* ===============================================
   포인트 표시 컴포넌트
   =============================================== */
.user-points,
.points-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.user-points.premium,
.points-display.premium {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
}

.user-points::before,
.points-display::before {
    content: "💰";
    font-size: 12px;
}

.user-points.premium::before,
.points-display.premium::before {
    content: "👑";
}

/* ===============================================
   반응형 디자인
   =============================================== */
@media (max-width: 768px) {
    .points-modal-content {
        width: 95%;
        margin: 20px;
    }

    .daily-reward-modal-content {
        width: 95%;
        margin: 20px;
    }

    .confirm-modal-content {
        width: 95%;
        margin: 20px;
    }

    .points-toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .points-modal-header,
    .points-modal-body,
    .points-modal-footer {
        padding: 16px;
    }

    .daily-reward-header {
        padding: 24px 16px 16px;
    }

    .daily-reward-body {
        padding: 0 16px 16px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 16px;
    }
}

/* ===============================================
   다크 모드 지원 (선택사항)
   =============================================== */
@media (prefers-color-scheme: dark) {
    .points-modal-content {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        color: white;
    }

    .points-modal-header {
        border-bottom-color: #4a5568;
    }

    .points-info {
        background: #4a5568;
    }

    .solution-options {
        background: #2b6cb0;
        color: white;
    }

    .points-toast-content {
        background: #2d3748;
        color: white;
    }

    .confirm-modal-content {
        background: #2d3748;
        color: white;
    }

    .confirm-modal-header {
        border-bottom-color: #4a5568;
    }
}