/* 로또 번호 추천 페이지 스타일 */

.lotto-page {
    max-width: 800px;
}

.lotto-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
}

.lotto-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.lotto-section h3 .material-icons-round {
    font-size: 20px;
}

/* 모드 선택 탭 */
.mode-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mode-tab {
    flex: 1;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-tab:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
}

.mode-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-color: var(--accent);
    color: var(--accent);
}

.mode-tab .material-icons-round {
    font-size: 20px;
}

/* 모드 옵션 */
.mode-options {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.option-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.option-row:last-child {
    margin-bottom: 0;
}

.option-group {
    flex: 1;
}

.option-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.option-group input,
.option-group select {
    width: 100%;
}

.option-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 생성 컨트롤 */
.generate-controls {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
}

.count-control {
    flex: 1;
}

.count-control label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.count-btns {
    display: flex;
    gap: 8px;
}

.count-btn {
    padding: 10px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.count-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
}

.count-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a1a1a;
    font-weight: 600;
}

.generate-btn {
    min-width: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.generate-btn .material-icons-round {
    font-size: 20px;
}

/* 결과 섹션 */
.result-section h3 {
    justify-content: flex-start;
}

.copy-all-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-all-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.copy-all-btn .material-icons-round {
    font-size: 14px;
}

/* 로또 결과 */
.lotto-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lotto-game {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.game-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    min-width: 24px;
}

.lotto-balls {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.lotto-ball {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow:
        inset 0 -3px 6px rgba(0, 0, 0, 0.2),
        inset 0 3px 6px rgba(255, 255, 255, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.3);
    animation: ballPop 0.3s ease backwards;
}

.lotto-ball:nth-child(1) {
    animation-delay: 0.05s;
}

.lotto-ball:nth-child(2) {
    animation-delay: 0.1s;
}

.lotto-ball:nth-child(3) {
    animation-delay: 0.15s;
}

.lotto-ball:nth-child(4) {
    animation-delay: 0.2s;
}

.lotto-ball:nth-child(5) {
    animation-delay: 0.25s;
}

.lotto-ball:nth-child(6) {
    animation-delay: 0.3s;
}

@keyframes ballPop {
    from {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

/* 번호 색상 (동행복권 기준) */
.lotto-ball.range-1 {
    background: linear-gradient(135deg, #fbc400, #e5a800);
}

/* 1-10 노랑 */
.lotto-ball.range-2 {
    background: linear-gradient(135deg, #69c8f2, #4ab3e6);
}

/* 11-20 파랑 */
.lotto-ball.range-3 {
    background: linear-gradient(135deg, #ff7272, #e65555);
}

/* 21-30 빨강 */
.lotto-ball.range-4 {
    background: linear-gradient(135deg, #aaaaaa, #888888);
}

/* 31-40 회색 */
.lotto-ball.range-5 {
    background: linear-gradient(135deg, #b0d840, #96c428);
}

/* 41-45 초록 */

.game-copy-btn {
    padding: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.game-copy-btn:hover {
    background: var(--bg-card);
    color: var(--accent);
}

/* 통계 섹션 */
.stats-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.stats-tab {
    padding: 8px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.stats-tab:hover {
    border-color: var(--border-accent);
}

.stats-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a1a1a;
    font-weight: 600;
}

.stats-display {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 8px;
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.stat-ball {
    aspect-ratio: 1;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    position: relative;
    cursor: default;
    transition: transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid transparent;
    /* 기본 테두리 */
}

.stat-ball:hover {
    transform: scale(1.1);
    z-index: 10;
}

.stat-ball .stat-count {
    position: absolute;
    bottom: -6px;
    font-size: 0.6rem;
    background: var(--bg-card);
    color: var(--text-secondary);
    padding: 1px 5px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Hot Number Highlight (뜨거운 번호: 또렷하고 큼) */
.stat-ball.hot {
    border: 3px solid #ff4757;
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.6);
    /* 강한 붉은 광 */
    transform: scale(1.15);
    /* 크기 확대 */
    z-index: 10;
    opacity: 1 !important;
    /* 무조건 선명하게 */
    filter: none;
}

/* Cold Number Highlight (차가운 번호: 흐릿하고 작음) */
.stat-ball.cold-highlight {
    border: 2px solid #3498db;
    box-shadow: inset 0 0 10px rgba(52, 152, 219, 0.3);
    /* 안쪽으로 차가운 느낌 */
    transform: scale(0.9);
    /* 크기 축소 */
    opacity: 0.6;
    /* 반투명 (흐릿함) */
    filter: saturate(0.5);
    /* 채도 감소 */
}

/* Original Cold Style (Used for 'recent' stats mostly) */
.stat-ball.cold {
    opacity: 0.4;
    filter: grayscale(0.8);
    transform: scale(0.9);
}

/* 면책 조항 */
.lotto-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 16px;
    background: rgba(201, 162, 39, 0.1);
    border: 1px solid var(--border-accent);
    border-radius: 10px;
    margin-top: 10px;
}

.lotto-disclaimer .material-icons-round {
    color: var(--accent);
    font-size: 20px;
    flex-shrink: 0;
}

.lotto-disclaimer p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* 반응형 */
@media (max-width: 600px) {
    .lotto-section {
        padding: 16px;
    }

    .mode-tab {
        min-width: 100px;
        padding: 12px 14px;
        font-size: 0.8rem;
    }

    .option-row {
        flex-direction: column;
        gap: 12px;
    }

    .generate-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .count-control {
        width: 100%;
    }

    .count-btns {
        width: 100%;
    }

    .count-btn {
        flex: 1;
    }

    .generate-btn {
        width: 100%;
    }

    .lotto-game {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .game-label {
        text-align: center;
    }

    .lotto-balls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .lotto-ball {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }

    .game-copy-btn {
        align-self: center;
    }
}

/* 온라인 구매 안내 섹션 */
.online-purchase-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 10px;
}

.online-purchase-content p {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
}

.online-purchase-content strong {
    color: var(--accent);
    font-weight: 700;
}

.purchase-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #00C73C, #009E30);
    /* 동행복권 느낌의 초록색 */
    color: white;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 199, 60, 0.2);
}

.purchase-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 199, 60, 0.3);
    background: linear-gradient(135deg, #00D640, #00B336);
}

.purchase-link .material-icons-round {
    font-size: 20px;
}

/* Date Range Picker */
.date-range-group .date-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.date-input {
    flex: 1;
    padding: 8px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    min-width: 0;
    cursor: pointer;
}

select.date-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 30px;
}

.date-input:focus {
    outline: none;
    border-color: var(--accent);
}

.small-btn {
    width: 100%;
    padding: 8px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

.small-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.filtered-count {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--accent);
    text-align: right;
}