/**
 * P2P Auth System - Styles
 */

/* 헤더 버튼 컨테이너 */
.p2p-auth-header-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 네비게이션 메뉴 아이템 */
.p2p-auth-menu-item {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

/* 공통 버튼 스타일 */
.p2p-auth-btn {
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.p2p-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 모달 애니메이션 */
#p2p-auth-modal-bg,
#p2p-edit-modal-bg,
#p2p-history-modal-bg {
    animation: fadeIn 0.3s ease;
}

#p2p-auth-modal,
#p2p-edit-modal,
#p2p-history-modal {
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .p2p-auth-btn {
        font-size: 12px !important;
        padding: 6px 12px !important;
        text-align: center;
    }
    
    #p2p-auth-modal,
    #p2p-edit-modal,
    #p2p-history-modal {
        margin: 20px 0;
        max-height: calc(100vh - 40px);
    }
    
    /* 모바일에서 거래내역 테이블 */
    #trade-history-content table {
        font-size: 12px;
    }
    
    #trade-history-content table th,
    #trade-history-content table td {
        padding: 8px !important;
    }
    
    /* 페이지네이션 버튼 크기 조정 */
    .page-btn {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }
}

/* Blocksy 테마 호환성 */
.ct-header .p2p-auth-menu-item {
    display: flex;
    align-items: center;
}

.ct-header .p2p-auth-btn {
    white-space: nowrap;
}

/* 다크모드 지원 */
@media (prefers-color-scheme: dark) {
    #p2p-auth-modal,
    #p2p-edit-modal,
    #p2p-history-modal {
        background: #1a1a1a;
        color: #fff;
    }
    
    #p2p-auth-modal input,
    #p2p-auth-modal textarea,
    #p2p-edit-modal input,
    #p2p-edit-modal textarea {
        background: #2a2a2a;
        color: #fff;
        border-color: #444;
    }
    
    #p2p-auth-modal label,
    #p2p-edit-modal label {
        color: #ccc;
    }
}

/* 거래내역 테이블 스타일 */
#trade-history-content table {
    font-size: 14px;
}

#trade-history-content table th {
    font-weight: bold;
    background: #f5f5f5;
}

#trade-history-content table tr:hover {
    background: #f9f9f9;
}

/* 거래내역 컨테이너 스크롤 */
#trade-history-container {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

#trade-history-container::-webkit-scrollbar {
    width: 8px;
}

#trade-history-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#trade-history-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#trade-history-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 페이지네이션 버튼 호버 효과 */
.page-btn:hover {
    background: #e3f2fd !important;
    border-color: #2196F3 !important;
}

.page-btn:active {
    transform: scale(0.95);
}

/* 스크롤바 스타일 */
#p2p-auth-modal::-webkit-scrollbar,
#p2p-edit-modal::-webkit-scrollbar,
#p2p-history-modal::-webkit-scrollbar {
    width: 8px;
}

#p2p-auth-modal::-webkit-scrollbar-track,
#p2p-edit-modal::-webkit-scrollbar-track,
#p2p-history-modal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#p2p-auth-modal::-webkit-scrollbar-thumb,
#p2p-edit-modal::-webkit-scrollbar-thumb,
#p2p-history-modal::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#p2p-auth-modal::-webkit-scrollbar-thumb:hover,
#p2p-edit-modal::-webkit-scrollbar-thumb:hover,
#p2p-history-modal::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 로딩 애니메이션 */
.p2p-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 입력 필드 포커스 스타일 */
#p2p-auth-modal input:focus,
#p2p-auth-modal textarea:focus,
#p2p-edit-modal input:focus,
#p2p-edit-modal textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* 버튼 비활성화 상태 */
.p2p-auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 경고 메시지 */
.p2p-auth-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* 성공 메시지 */
.p2p-auth-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* 에러 메시지 */
.p2p-auth-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}