/* ================================
   상점 스타일 - 블랙 모던 테마
================================ */

/* 상점 페이지 컨테이너 */
.shop-container {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.shop-container h2 {
    text-align: center;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* 골드 표시 */
.shop-gold-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--gold-primary);
    border-radius: 20px;
    margin: 16px auto;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
}

.shop-gold-display .gold-icon {
    font-size: 24px;
}

.shop-gold-display .gold-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--gold-primary);
}

/* 상점 탭 */
.shop-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.shop-tab {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.shop-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.shop-tab.active {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-light) 100%);
    color: #000000;
    border-color: transparent;
}

/* 상점 아이템 그리드 */
.shop-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

/* 상점 아이템 카드 */
.shop-item-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1;
}

.shop-item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border-color: var(--gold-primary);
}

.shop-item-card img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 8px;
}

.shop-item-card .item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.shop-item-card .item-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.3;
    min-height: 28px;
}

.shop-item-card .item-owned {
    font-size: 12px;
    color: var(--neon-green);
    font-weight: 600;
    margin-bottom: 4px;
}

.shop-item-card.owned {
    border: 1px solid var(--neon-green);
    background: rgba(0, 255, 136, 0.05);
}

.shop-item-card .item-price {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 700;
    color: var(--gold-primary);
    margin-bottom: 8px;
}

.shop-item-card .item-price::before {
    content: '💰';
}

.shop-item-card .btn-buy {
    width: 100%;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--neon-green) 0%, #00cc6a 100%);
    color: #000000;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.shop-item-card .btn-buy:hover {
    background: linear-gradient(135deg, #00cc6a 0%, var(--neon-green) 100%);
    transform: scale(1.02);
}

.shop-item-card .btn-buy:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.shop-item-card .btn-buy.not-affordable {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

/* 구매 성공 애니메이션 */
.shop-item-card.purchase-success {
    animation: purchaseSuccess 0.5s ease;
}

@keyframes purchaseSuccess {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
        background-color: rgba(0, 255, 136, 0.1);
    }

    100% {
        transform: scale(1);
    }
}

/* 상점 비어있음 */
.shop-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* 수량 선택 (선택적) */
.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.quantity-selector button {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.quantity-selector button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.quantity-selector input {
    width: 40px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 4px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.quantity-selector input:focus {
    outline: none;
    border-color: var(--gold-primary);
    background: rgba(255, 255, 255, 0.1);
}

.quantity-selector button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 총 가격 표시 */
.item-total-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--gold-primary);
    margin-bottom: 8px;
    text-align: center;
}

/* 반응형 */
@media (max-width: 480px) {
    .shop-items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .shop-item-card {
        padding: 12px;
    }

    .shop-item-card img {
        width: 48px;
        height: 48px;
    }
}

/* ================================
   마스터볼 전용 스타일
================================ */

.master-ball-card {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 50%, #6c3483 100%) !important;
    border: 2px solid #f39c12 !important;
    box-shadow: 0 4px 20px rgba(155, 89, 182, 0.5), 0 0 15px rgba(243, 156, 18, 0.3) !important;
    position: relative;
    overflow: hidden;
}

.master-ball-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    animation: masterBallGlow 3s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes masterBallGlow {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(10%, 10%) scale(1.1);
        opacity: 0.8;
    }
}

.master-ball-card:hover {
    transform: translateY(-6px) scale(1.02) !important;
    box-shadow: 0 8px 30px rgba(155, 89, 182, 0.7), 0 0 25px rgba(243, 156, 18, 0.5) !important;
}

.master-ball-card .item-name {
    color: #ffd700 !important;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.master-ball-card .item-price {
    color: #ffd700 !important;
}

.master-ball-cooldown {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 6px 10px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: #ff6b6b;
    font-weight: 600;
}

.master-ball-cooldown .cooldown-icon {
    font-size: 16px;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.master-ball-remaining {
    background: rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 6px 10px;
    margin: 8px 0;
    font-size: 12px;
    color: #ffd700;
    font-weight: 600;
    text-align: center;
}

.cooldown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 10;
}

.btn-disabled {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed !important;
}

/* ================================
   프로필 업로드 모달 스타일
================================ */

.profile-upload-modal-content {
    max-width: 400px;
    text-align: center;
}

.profile-upload-modal-content h2 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.profile-upload-modal-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.profile-upload-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.preview-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.preview-placeholder .preview-icon {
    font-size: 60px;
}

.preview-placeholder .profile-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-upload-form {
    margin-bottom: 20px;
}

.profile-upload-form .btn-secondary {
    padding: 10px 24px;
}

/* 트레이너 프로필 이미지 */
.trainer-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 8px;
    overflow: hidden;
}

.trainer-profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 배틀 트레이너 프로필 이미지 */
.battle-trainer .trainer-avatar {
    width: 50px;
    height: 50px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

/* ================================
   비밀번호 변경 모달 스타일
================================ */

.change-password-modal-content {
    max-width: 400px;
    text-align: center;
}

.change-password-modal-content h2 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.change-password-modal-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.change-password-form {
    margin-bottom: 20px;
    text-align: left;
}

.change-password-form .form-group {
    margin-bottom: 16px;
}

.change-password-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.change-password-form input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition-fast);
    box-sizing: border-box;
}

.change-password-form input:focus {
    outline: none;
    border-color: var(--pokemon-blue);
    background: rgba(255, 255, 255, 0.08);
}

.change-password-form input::placeholder {
    color: var(--text-secondary);
}

/* 마이룸 owner-avatar 프로필 이미지 */
.owner-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.owner-profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
