/**
 * 판매점 찾기 스타일
 */

/* Container */
.store-finder-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - var(--nav-height) - 32px);
    gap: 12px;
    padding: 0;
}

/* Search Bar */
.store-search-bar {
    display: flex;
    gap: 8px;
    padding: 0 4px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper i.fa-search {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.search-input-wrapper input {
    width: 100%;
    padding: 12px 40px 12px 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(251, 196, 0, 0.1);
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.search-input-wrapper .clear-btn {
    position: absolute;
    right: 8px;
    padding: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.search-input-wrapper .clear-btn:hover {
    color: var(--text-primary);
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border-radius: var(--border-radius-sm);
    flex-shrink: 0;
}

/* Filter Tabs */
.store-filter-tabs {
    display: flex;
    gap: 8px;
    padding: 0 4px;
}

.store-filter-tabs .filter-tab {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.store-filter-tabs .filter-tab:hover {
    background: var(--bg-hover);
}

.store-filter-tabs .filter-tab.active {
    background: var(--primary);
    color: #1a1a2e;
    border-color: var(--primary);
    font-weight: 600;
}

.store-filter-tabs .filter-tab i {
    font-size: 0.85rem;
}

/* Map Container */
.store-map {
    flex: 1;
    min-height: 280px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-card);
    position: relative;
}

.map-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

.map-placeholder i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.map-placeholder p {
    font-size: 0.95rem;
    margin: 4px 0;
}

.map-placeholder .map-hint {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Store List */
.store-list {
    flex: 0 0 auto;
    max-height: 40%;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.store-list-header {
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    background: var(--bg-card);
}

.store-list-items {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Store List Item - 로또매니아 스타일 */
.store-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: var(--transition-fast);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.store-list-item:hover {
    background: var(--bg-hover);
}

.store-list-item:active {
    background: rgba(255, 255, 255, 0.08);
}

.store-list-item.winner {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.08), transparent);
    border-left: 3px solid var(--primary);
}

.store-list-item.winner:hover {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.12), transparent);
}

/* 순위 표시 */
.store-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.store-rank.winner {
    background: linear-gradient(135deg, var(--primary), #ff9500);
    color: #1a1a2e;
}

/* 컨텐츠 영역 */
.store-item-content {
    flex: 1;
    min-width: 0;
}

.store-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.store-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* 명당 배지 - 등급별 */
.winner-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.winner-badge.legendary {
    background: linear-gradient(135deg, #ff6b6b, #ffd93d, #6bcb77, #4d96ff);
    background-size: 300% 300%;
    animation: gradientShift 3s ease infinite;
    color: #1a1a2e;
    text-shadow: 0 0 2px rgba(255,255,255,0.5);
}

.winner-badge.gold {
    background: linear-gradient(135deg, var(--primary), #ff9500);
    color: #1a1a2e;
}

.winner-badge.silver {
    background: linear-gradient(135deg, #a8a8a8, #d4d4d4);
    color: #333;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 최근 당첨 정보 */
.recent-win {
    font-size: 0.7rem;
    color: var(--primary);
    background: rgba(255, 215, 0, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

.store-item-address {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

.store-item-address i {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.store-item-meta {
    margin-top: 4px;
}

/* 오른쪽 영역 */
.store-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.store-item-distance {
    font-size: 0.85rem;
    color: var(--info);
    font-weight: 600;
}

.store-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.5;
}

/* Empty State */
.store-empty-hint {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 4px;
}

/* Empty State */
.store-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.store-empty i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.store-empty p {
    font-size: 0.9rem;
}

/* Map Markers */
.store-marker {
    width: 30px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    transition: transform 0.2s;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.store-marker:hover {
    transform: scale(1.2);
}

.store-marker.normal {
    color: #3b82f6;
}

.store-marker.winner {
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
}

/* Current Location Marker */
.current-location-marker {
    width: 30px;
    height: 30px;
    position: relative;
}

.current-location-marker .dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: var(--primary);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.current-location-marker .pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    animation: locationPulse 2s infinite;
}

@keyframes locationPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Info Window */
.store-info-window {
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    max-width: 280px;
    border: 1px solid rgba(255,255,255,0.1);
}

.store-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.store-info-header .store-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.store-info-header .win-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: linear-gradient(135deg, var(--primary), #ff9500);
    color: #1a1a2e;
    border-radius: 4px;
    font-weight: 700;
}

.store-info-window .store-address {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.store-info-window .store-distance {
    font-size: 0.75rem;
    color: var(--info);
    margin-top: 6px;
    font-weight: 500;
}

/* API Key Missing Warning */
.api-key-warning {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    text-align: center;
    color: #ff9800;
}

.api-key-warning i {
    font-size: 2rem;
    margin-bottom: 8px;
}

.api-key-warning h4 {
    margin: 8px 0;
    font-size: 1rem;
}

.api-key-warning p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 4px 0;
}

.api-key-warning code {
    background: rgba(0,0,0,0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
}

/* Light Theme */
[data-theme="light"] .search-input-wrapper input {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .store-filter-tabs .filter-tab {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
    color: #666;
}

[data-theme="light"] .store-filter-tabs .filter-tab.active {
    background: var(--primary);
    color: #1a1a2e;
}

[data-theme="light"] .store-map {
    background: #f5f5f5;
}

[data-theme="light"] .store-list {
    background: #fff;
}

[data-theme="light"] .store-list-header {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .store-list-item {
    border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .store-list-item:hover {
    background: #f5f5f5;
}

[data-theme="light"] .store-item-icon {
    background: #f0f0f0;
}

[data-theme="light"] .store-item-name {
    color: #333;
}

[data-theme="light"] .store-info-window {
    background: #fff;
    border-color: rgba(0,0,0,0.1);
}

/* Responsive */
@media (max-width: 480px) {
    .store-finder-container {
        height: calc(100vh - var(--header-height) - var(--nav-height) - 16px);
        gap: 8px;
    }

    .store-map {
        min-height: 240px;
    }

    .store-list {
        max-height: 35%;
    }

    .store-list-item {
        padding: 12px 14px;
    }

    .store-item-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .store-item-name {
        font-size: 0.9rem;
    }

    .store-item-address {
        font-size: 0.75rem;
    }
}

/* Loading state */
.store-list-items.loading::after {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    margin: 20px auto;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   회차별 당첨점 스타일
   ============================================ */

.round-winners-container {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.round-winners-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.round-winners-header .card-title {
    margin: 0;
    font-size: 1.2rem;
}

.winners-status {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.winners-status i {
    margin-right: 4px;
}

/* Round Selector */
.round-selector-wrapper {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 12px 16px;
}

.round-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.round-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--bg-hover);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.round-nav-btn:hover:not(:disabled) {
    background: var(--primary);
    color: #1a1a2e;
}

.round-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.round-dropdown {
    flex: 1;
    max-width: 200px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}

.round-dropdown:focus {
    outline: none;
    border-color: var(--primary);
}

/* Draw Info */
.round-draw-info {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 16px;
    text-align: center;
}

.draw-numbers-mini {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.ball-mini {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
}

.ball-mini.ball-1 { background: linear-gradient(135deg, #fbc400, #e5a800); }
.ball-mini.ball-2 { background: linear-gradient(135deg, #69c8f2, #4ab0e0); }
.ball-mini.ball-3 { background: linear-gradient(135deg, #ff7272, #e64545); }
.ball-mini.ball-4 { background: linear-gradient(135deg, #aaa, #888); }
.ball-mini.ball-5 { background: linear-gradient(135deg, #b0d840, #8cc600); }
.ball-mini.ball-bonus { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

.plus-mini {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    margin: 0 4px;
}

.draw-date-mini {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Winners List */
.round-winners-list {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.winners-count {
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 215, 0, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.winners-count i {
    color: var(--primary);
    margin-right: 8px;
}

.winner-store-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: var(--transition-fast);
}

.winner-store-item:hover {
    background: var(--bg-hover);
}

.winner-store-item:active {
    background: rgba(255, 215, 0, 0.1);
}

.winner-store-item:last-child {
    border-bottom: none;
}

.winner-store-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #ff9500);
    color: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.winner-store-info {
    flex: 1;
    min-width: 0;
}

.winner-store-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.winner-store-address {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.winner-store-method {
    display: flex;
    gap: 6px;
}

.method-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.method-badge.auto {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.method-badge.manual {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.winner-store-action {
    color: var(--primary);
    font-size: 1.1rem;
    opacity: 0.7;
    transition: var(--transition-fast);
}

.winner-store-item:hover .winner-store-action {
    opacity: 1;
    transform: translateX(4px);
}

/* Empty & Loading States */
.round-winners-empty,
.round-winners-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.round-winners-empty i,
.round-winners-loading i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.round-winners-loading i {
    color: var(--primary);
    opacity: 1;
}

.round-winners-empty p,
.round-winners-loading p {
    font-size: 0.95rem;
}

/* Crawl Section */
.crawl-section {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
}

.crawl-info {
    font-size: 0.9rem;
    color: var(--warning);
    margin-bottom: 16px;
}

.crawl-info i {
    margin-right: 6px;
}

/* Light Theme */
[data-theme="light"] .round-selector-wrapper {
    background: #fff;
}

[data-theme="light"] .round-nav-btn {
    background: #f5f5f5;
    border-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

[data-theme="light"] .round-dropdown {
    background: #f5f5f5;
    border-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

[data-theme="light"] .round-draw-info {
    background: #fff;
}

[data-theme="light"] .round-winners-list {
    background: #fff;
}

[data-theme="light"] .winner-store-item {
    border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .winner-store-item:hover {
    background: #f5f5f5;
}

[data-theme="light"] .crawl-section {
    background: #fff;
}

/* Responsive */
@media (max-width: 480px) {
    .round-winners-container {
        padding: 12px;
        gap: 12px;
    }

    .round-winners-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .round-selector {
        gap: 8px;
    }

    .round-nav-btn {
        width: 36px;
        height: 36px;
    }

    .round-dropdown {
        max-width: 160px;
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .ball-mini {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .winner-store-item {
        padding: 12px;
    }

    .winner-store-rank {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}

/* 위치 버튼 강조 애니메이션 */
.btn-icon.pulse-hint {
    animation: pulse-hint 1.5s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(251, 196, 0, 0.7);
}

@keyframes pulse-hint {
    0% {
        box-shadow: 0 0 0 0 rgba(251, 196, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(251, 196, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(251, 196, 0, 0);
    }
}

/* 위치 권한 안내 모달 */
.location-guide-modal {
    max-width: 340px;
}

.location-guide-modal .modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

.location-guide-modal .modal-header h3 i {
    color: var(--primary);
}

.location-guide-modal .modal-body {
    padding: 20px;
}

.location-guide-modal ol {
    margin: 12px 0;
    padding-left: 24px;
}

.location-guide-modal ol li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.location-guide-modal .guide-note {
    margin-top: 16px;
    padding: 12px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    color: #ffc107;
}

.location-guide-modal .guide-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.location-guide-modal .guide-actions .btn {
    flex: 1;
}