/* ================================
   팀 관리 페이지 스타일 - 블랙 모던 테마
================================ */

.team-container {
    padding: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.team-container h2 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.team-container .page-desc {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* 현재 팀 슬롯 컨테이너 */
.team-slots-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.team-slots-container h3 {
    color: var(--gold-primary);
    margin-bottom: 16px;
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.team-slots {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .team-slots {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 팀 슬롯 - 흰색 배경 */
.team-slot {
    aspect-ratio: 1;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 90px;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.team-slot:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
    border-color: var(--gold-primary);
}

.team-slot.empty {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.team-slot .slot-number {
    position: absolute;
    top: 4px;
    left: 8px;
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--gold-primary);
    opacity: 0.8;
}

.team-slot .slot-placeholder {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.4);
}

.team-slot img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.team-slot .pokemon-name {
    font-size: 0.7rem;
    color: #2c3e50;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
    text-align: center;
    font-weight: 600;
}

.team-slot .pokemon-level {
    font-size: 0.65rem;
    color: rgba(44, 62, 80, 0.7);
}

.team-slot .remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--neon-red);
    color: white;
    border: none;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.team-slot:hover .remove-btn {
    opacity: 1;
}

/* 보유 포켓몬 목록 컨테이너 - 다크 테마 */
.team-pokemon-list-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.team-pokemon-list-container h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.team-pokemon-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}

/* 스크롤바 스타일 */
.team-pokemon-list::-webkit-scrollbar {
    width: 8px;
}

.team-pokemon-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.team-pokemon-list::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.4);
    border-radius: 4px;
}

.team-pokemon-list::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.6);
}

/* 포켓몬 아이템 - 다크 테마 */
.team-pokemon-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    contain: layout style paint;
    content-visibility: auto;
}

.team-pokemon-item:hover {
    background: #f5f5f5;
    transform: translateY(-2px);
    border-color: var(--gold-primary);
}

.team-pokemon-item.in-team {
    border-color: var(--neon-cyan);
    background: rgba(0, 212, 255, 0.1);
}

.team-pokemon-item.in-team::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--neon-cyan);
    color: #000;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.team-pokemon-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.team-pokemon-item .name {
    font-size: 0.7rem;
    color: #2c3e50;
    margin-top: 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    font-weight: 600;
}

/* 등급별 텍스트 색상 조정 */
.team-pokemon-item.rarity-legendary .name {
    color: rgba(133, 88, 0, 1) !important;
}

.team-pokemon-item.rarity-mythical .name {
    color: rgba(136, 14, 79, 1) !important;
}

.team-pokemon-item.rarity-epic .name {
    color: rgba(74, 20, 140, 1) !important;
}

.team-pokemon-item.rarity-rare .name {
    color: rgba(13, 71, 161, 1) !important;
}

.team-pokemon-item.rarity-uncommon .name {
    color: rgba(27, 94, 32, 1) !important;
}

.team-pokemon-item .level {
    font-size: 0.65rem;
    color: rgba(44, 62, 80, 0.7);
}

/* 등급별 레벨 텍스트 색상 */
.team-pokemon-item.rarity-legendary .level {
    color: rgba(133, 88, 0, 0.8) !important;
}

.team-pokemon-item.rarity-mythical .level {
    color: rgba(136, 14, 79, 0.8) !important;
}

.team-pokemon-item.rarity-epic .level {
    color: rgba(74, 20, 140, 0.8) !important;
}

.team-pokemon-item.rarity-rare .level {
    color: rgba(13, 71, 161, 0.8) !important;
}

.team-pokemon-item.rarity-uncommon .level {
    color: rgba(27, 94, 32, 0.8) !important;
}

/* 희귀도 색상 - 등급별 linear-gradient 배경 */
.team-pokemon-item.rarity-legendary {
    background: linear-gradient(135deg, #fff8e1, #ffb74d) !important;
    border-color: rgba(255, 215, 0, 0.6);
    border-width: 2px;
}

.team-pokemon-item.rarity-mythical {
    background: linear-gradient(135deg, #fce4ec, #f06292) !important;
    border-color: rgba(236, 72, 153, 0.6);
    border-width: 2px;
}

.team-pokemon-item.rarity-epic {
    background: linear-gradient(135deg, #f3e5f5, #ba68c8) !important;
    border-color: rgba(168, 85, 247, 0.6);
    border-width: 2px;
}

.team-pokemon-item.rarity-rare {
    background: linear-gradient(135deg, #e3f2fd, #64b5f6) !important;
    border-color: rgba(59, 130, 246, 0.6);
    border-width: 2px;
}

.team-pokemon-item.rarity-uncommon {
    background: linear-gradient(135deg, #f1f8e9, #81c784) !important;
    border-color: rgba(34, 197, 94, 0.6);
    border-width: 2px;
}

/* 배틀 횟수 표시 - 다크 테마 */
.battle-count-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 1rem;
    color: var(--text-primary);
}

.battle-count-display .battle-icon {
    font-size: 1.2rem;
}

.battle-count-display strong {
    color: var(--neon-red);
    font-size: 1.2rem;
}

.battle-count-display .recharge-timer {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 8px;
}

.battle-count-display .recharge-timer::before {
    content: '(';
}

.battle-count-display .recharge-timer::after {
    content: ')';
}

/* 필터 버튼 스타일 - 다크 테마 */
.filter-container {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

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

.filter-btn.active {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    color: #000;
    border-color: transparent;
    font-weight: bold;
}

/* 검색 입력 필드 스타일 - 다크 테마 */
.team-pokemon-list-container .search-filter {
    position: relative;
    margin-bottom: 16px;
}

.team-pokemon-list-container .search-filter input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.team-pokemon-list-container .search-filter input:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.team-pokemon-list-container .search-filter input::placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 검색 아이콘 */
.team-pokemon-list-container .search-filter::before {
    content: '🔍';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.team-pokemon-list-container .search-filter:focus-within::before {
    opacity: 1;
}

/* 정렬 셀렉트 - 다크 테마 */
.team-sort-select {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.team-sort-select:hover {
    background: rgba(255, 255, 255, 0.1);
}

.team-sort-select:focus {
    outline: none;
    border-color: var(--gold-primary);
}

.team-sort-select option {
    background: #1a1a1a;
    color: var(--text-primary);
}

/* 검색 로우 */
.search-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.search-row .search-filter {
    flex: 1;
    margin-bottom: 0 !important;
}

/* ======================================
   팀 프리셋 (슬롯) 스타일 - 다크 테마
====================================== */

.team-presets-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.team-presets-container h3 {
    color: var(--gold-primary);
    margin-bottom: 8px;
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.team-presets-container .preset-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.team-presets-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

@media (max-width: 900px) {
    .team-presets-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .team-presets-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 프리셋 슬롯 - 다크 테마 */
.preset-slot {
    background: rgba(30, 30, 30, 0.9);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    min-height: 120px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    contain: layout style paint;
    content-visibility: auto;
}

.preset-slot:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.2);
    border-color: var(--gold-primary);
}

.preset-slot.empty {
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed rgba(255, 255, 255, 0.2);
}

.preset-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.preset-number {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    color: #000;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    flex-shrink: 0;
}

.preset-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.preset-name:hover {
    color: var(--gold-primary);
}

.preset-empty-message {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preset-pokemon-icons {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1;
    align-items: center;
}

.preset-pokemon-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.preset-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.preset-btn {
    flex: 1;
    padding: 6px 8px;
    border: none;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: fit-content;
}

.preset-btn.apply {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    color: #000;
}

.preset-btn.apply:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

.preset-btn.save {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.preset-btn.save:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.preset-btn.delete {
    background: rgba(255, 51, 102, 0.2);
    color: var(--neon-red);
    flex: 0;
    padding: 6px 10px;
}

.preset-btn.delete:hover {
    background: rgba(255, 51, 102, 0.3);
}
