/* 통합된 정기결제 모달 스타일 */

/* 기존 모달 스타일 제거됨 - 토스트 알림으로 대체 */
/* 이제 모든 알림은 우측 상단 토스트 형태로 표시됩니다 */

/* 로딩 오버레이 스타일 */
.payment-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content p {
    margin: 0;
    font-size: 1.1em;
    color: #333;
    font-weight: 500;
}

/* 기본 모달 컨테이너 */
.subscription-payment-content {
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(135deg, #fff 0%, #f8f9ff 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    position: relative;
}

/* 모달 헤더 */
.subscription-payment-header {
    text-align: center;
    padding: 30px 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin: -20px -20px 20px;
    border-radius: 20px 20px 0 0;
}

.subscription-payment-header h2 {
    margin: 0 0 15px;
    font-size: 24px;
    font-weight: 700;
}

/* 구독 정보 표시 */
.subscription-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
}

.subscription-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.5em;
    font-weight: 600;
}

.plan-price {
    font-size: 2em;
    font-weight: 700;
    margin: 10px 0;
    color: #ffeb3b;
}

.platform-id {
    font-size: 0.9em;
    opacity: 0.9;
    margin: 5px 0;
}

.payment-info {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
}

.payment-info p {
    margin: 5px 0;
    font-size: 14px;
    font-weight: 500;
}

/* 플랫폼 입력 섹션 */
.platform-input-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid #667eea;
}

.platform-input-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
    font-weight: 600;
}

.platform-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.platform-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.platform-input-section small {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 0.85em;
    line-height: 1.4;
}

/* 결제 방법 선택 - 그리드 레이아웃 */
.payment-methods h4 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.payment-method-grid,
.payment-methods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
}

/* 결제 방법 버튼/옵션 - 통합 스타일 */
.payment-method-btn,
.payment-method-option {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 30px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-height: 160px;
    position: relative;
    overflow: hidden;
}

.payment-method-btn:hover,
.payment-method-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.payment-method-btn.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.payment-method-btn.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background: #4caf50;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

/* 결제 방법 아이콘 및 텍스트 */
.payment-icon,
.payment-method-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.payment-method-btn span,
.payment-method-name {
    font-weight: 600;
    font-size: 1.3em;
    color: #333;
    margin-bottom: 10px;
}

.payment-method-btn small,
.payment-method-desc {
    font-size: 1em;
    opacity: 0.7;
    margin-top: auto;
    color: #666;
    margin-bottom: 10px;
}

.payment-method-provider {
    font-size: 11px;
    color: #999;
    font-weight: 500;
}

.payment-method-btn.selected small {
    opacity: 0.9;
}

/* 결제 방법 배지 */
.payment-method-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.payment-method-option:nth-child(1) .payment-method-badge {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
}

.payment-method-option:nth-child(3) .payment-method-badge {
    background: linear-gradient(135deg, #feca57, #ff9ff3);
}

/* 약관 동의 및 알림 */
.subscription-terms,
.subscription-notice {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid #667eea;
}

.subscription-terms label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.subscription-terms input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.terms-note {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

.notice-title {
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    font-size: 16px;
}

.notice-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notice-list li {
    padding: 6px 0;
    color: #555;
    font-size: 14px;
    position: relative;
    padding-left: 20px;
}

.notice-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

/* 모달 액션 버튼 */
.modal-actions,
.subscription-payment-actions {
    display: flex;
    gap: 15px;
    justify-content: space-between;
    padding: 20px;
    text-align: center;
}

.modal-actions .btn,
.subscription-payment-actions .btn {
    flex: 1;
    padding: 15px 20px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
}

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

.modal-actions .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.modal-actions .btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.modal-actions .btn-secondary,
.subscription-payment-actions .btn-secondary {
    background: #f0f0f0;
    border: 2px solid #e0e0e0;
    color: #666;
}

.modal-actions .btn-secondary:hover,
.subscription-payment-actions .btn-secondary:hover {
    border-color: #ccc;
    background: #e0e0e0;
    color: #333;
}

/* 로딩 및 처리 상태 */
.payment-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.loading-content,
.processing-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.processing-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-spinner,
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content p,
.processing-animation p {
    margin: 0;
    color: #333;
    font-weight: 500;
}

.processing-animation h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 700;
}

/* 성공/실패 메시지 */
.subscription-success-message,
.subscription-error-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.success-icon,
.error-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.success-content h3,
.error-content h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.success-content p,
.error-content p {
    margin: 10px 0;
    color: #666;
    line-height: 1.4;
}

.error-content .btn {
    margin-top: 20px;
    padding: 10px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.error-content .btn:hover {
    background: #5a6fd8;
}

/* 간편결제 옵션 모달 스타일 */
#easypay-options-modal {
    z-index: 10001; /* 기존 모달보다 높은 z-index */
}

.easypay-options-content {
    max-width: 500px;
    width: 90%;
    background: linear-gradient(135deg, #fff 0%, #f8f9ff 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    position: relative;
}

.easypay-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 20px;
    margin-top: 20px;
}

/* 400px 이하에서 모바일 테스트용 특별 규칙 */
@media (max-width: 400px) {
    .easypay-options-grid,
    #easypay-options-modal .easypay-options-grid,
    .modal-content .easypay-options-grid,
    .easypay-options-content .easypay-options-grid {
        grid-template-columns: 1fr !important;
    }
}

.easypay-options-content h2 {
    text-align: center;
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.5em;
    font-weight: 700;
}

.easypay-options-content .payment-method-btn {
    transition: all 0.3s ease;
}

.easypay-options-content .payment-method-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

/* 브랜드별 로고 스타일 */
.payment-logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin-bottom: 8px;
}

.payment-logo.kakao {
    background: linear-gradient(135deg, #FEE500 0%, #FFD700 100%);
    color: #3C1E1E;
}

.payment-logo.naver {
    background: linear-gradient(135deg, #03C75A 0%, #2DB400 100%);
    color: white;
}

.payment-logo.toss {
    background: linear-gradient(135deg, #0050FF 0%, #004CFF 100%);
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.payment-logo.payco {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF5722 100%);
    color: white;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .subscription-payment-content {
        width: 95%;
        max-height: 95vh;
        margin: 2.5vh auto;
    }
    
    .payment-method-grid,
    .payment-methods-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
        padding: 15px;
    }
    
    .payment-method-btn,
    .payment-method-option {
        padding: 15px 10px;
        min-height: 100px;
    }
    
    .payment-icon,
    .payment-method-icon {
        font-size: 1.5em;
    }
    
    .payment-method-btn span,
    .payment-method-name {
        font-size: 0.85em;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
    }

    .subscription-payment-header {
        padding: 25px 20px 15px;
    }
    
    .subscription-payment-header h2 {
        font-size: 20px;
    }
    
    .subscription-notice {
        margin: 0 15px 15px;
        padding: 15px;
    }
    
    .subscription-payment-actions {
        padding: 15px;
    }
    
    .easypay-options-content {
        width: 95%;
        margin: 5vh auto;
    }
    
    .easypay-options-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
        padding: 15px;
    }
    
    /* 모바일에서 간편결제 옵션을 세로 1열로 강제 */
    #easypay-options-modal .easypay-options-grid {
        grid-template-columns: 1fr !important;
    }
    
    .modal-content .easypay-options-grid {
        grid-template-columns: 1fr !important;
    }
    
    .easypay-options-content h2 {
        font-size: 1.3em;
    }
}

@media (max-width: 480px) {
    .subscription-payment-content {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .payment-method-grid,
    .payment-methods-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        padding: 10px;
        gap: 8px;
    }
    
    /* 480px 이하에서도 간편결제 옵션 1열 강제 */
    .easypay-options-grid,
    #easypay-options-modal .easypay-options-grid,
    .modal-content .easypay-options-grid {
        grid-template-columns: 1fr !important;
    }
    
    .payment-method-btn,
    .payment-method-option {
        padding: 12px;
    }
    
    .payment-icon,
    .payment-method-icon {
        font-size: 24px;
        margin-bottom: 8px;
    }
    
    .payment-method-btn span,
    .payment-method-name {
        font-size: 14px;
    }
    
    .payment-method-desc {
        font-size: 12px;
    }
    
    .subscription-info {
        padding: 15px;
    }
    
    .plan-price {
        font-size: 1.8em;
    }

    .subscription-payment-header {
        padding: 20px 15px 12px;
    }
    
    .subscription-payment-header h2 {
        font-size: 18px;
    }
    
    .payment-info p {
        font-size: 13px;
    }
}