
/* --- 글로벌 스타일 --- */
:root {
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #333;
    --border-color: #e0e0e0;
    --primary-color: #4CAF50;
    --secondary-color: #FFC107;
    --accent-color: #2196F3;
    --sidebar-bg: #f8f9fa;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --border-color: #333;
    --primary-color: #66bb6a;
    --secondary-color: #ffd54f;
    --accent-color: #64b5f6;
    --sidebar-bg: #212121;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    transition: background-color 0.3s, color 0.3s;
}

.site-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* --- 사이드바 --- */
.sidebar {
    flex: 1;
    max-width: 360px;
    min-width: 280px;
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
    padding: 20px;
    background-color: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

#weekly-winner-announcement {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.feed-container {
    overflow-y: auto;
    flex-grow: 1;
}

.feed-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    margin-bottom: 12px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: background-color 0.3s;
}

.feed-item .numbers-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.feed-item .number-circle {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    margin: 2px;
}

.timestamp {
    font-size: 0.75rem;
    color: #888;
    text-align: center;
}

/* --- 메인 컨텐츠 --- */
.main-content {
    flex: 2.5;
    max-width: 800px;
    min-width: 500px;
    position: relative;
}

.main-card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: background-color 0.3s, border-color 0.3s;
}

/* --- 헤더 & 명언 --- */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
    flex-wrap: nowrap;
    white-space: nowrap;
}


.visitor-stats span {
    margin-left: 15px;
}

.quote-section {
    text-align: center;
    padding: 15px;
    margin: 20px 0;
    background-color: var(--bg-color);
    border-radius: 8px;
    cursor: pointer;
}

header h1 {
    text-align: center;
    color: var(--primary-color);
    font-weight: 900;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    text-align: center;
    font-size: 1rem;
    color: #6c757d;
    margin-top: 0;
}

/* --- 로더 애니메이션 --- */
#initial-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 0;
}

.rotating-ball-container {
    display: flex;
    gap: 10px;
}

@keyframes rotate360 {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#initial-loader .number-circle {
    animation: rotate360 2s linear infinite;
}


/* --- 번호 그리드 & 생성 결과 --- */
.feature-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.number-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}

.grid-number {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 45px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.grid-number:hover {
    background-color: var(--primary-color);
    color: white;
}

.grid-number.selected {
    background-color: var(--accent-color);
    color: white;
    font-weight: bold;
    border-color: var(--accent-color);
}

.lotto-games-wrapper {
    margin: 30px 0;
}

.lotto-set {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.lotto-game-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lotto-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.set-label {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent-color);
}

.numbers-container {
    display: flex;
    gap: 8px;
}

.number-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.number-circle:hover {
    transform: scale(1.1);
}

.color-yellow { background-color: #fbc400; }
.color-blue { background-color: #69c8f2; }
.color-red { background-color: #ff7272; }
.color-gray { background-color: #aaa; }
.color-green { background-color: #b0d840; }

.check-result {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 10px;
    text-align: center;
}

/* --- 버튼 스타일 --- */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.generate-btn-style, .kakao-btn-style, .lookup-button {
    flex-grow: 1;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.generate-btn-style {
    background-color: var(--primary-color);
    color: white;
}

.generate-btn-style:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.kakao-btn-style {
    background-color: #FEE500;
    color: #191919;
}

.copy-btn {
    padding: 8px 12px;
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background-color: #e0e0e0;
}

[data-theme="dark"] .copy-btn:hover {
    background-color: #333;
}

.mode-btn {
    position: fixed;
    top: 20px;
    right: 30px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.mode-btn #mode-icon {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.mode-btn:hover #mode-icon {
    transform: rotate(360deg);
}

/* --- 조회 섹션 --- */
.lookup-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.lookup-input {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.lookup-button {
    flex-grow: 0;
}

#lookup-result-container {
    margin-top: 20px;
    padding: 20px;
    background-color: var(--bg-color);
    border-radius: 8px;
    min-height: 50px;
}

.lotto-balls-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}


/* --- 기타 & 푸터 --- */
.divider {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    margin: 40px 0;
}

footer {
    text-align: center;
    margin-top: 30px;
    font-size: 0.9rem;
    color: #6c757d;
}

.disclaimer {
    font-style: italic;
}

.ads-section {
    min-width: 250px;
    margin: 20px auto;
    text-align: center;
}

/* --- 반응형 디자인 --- */
@media (max-width: 1200px) {
    .sidebar {
        display: none;
    }
    .main-content {
        min-width: 100%;
    }
}

@media (max-width: 600px) {
    body { padding: 10px; }
    .main-card { padding: 20px; }
    header h1 { font-size: 2rem; }
    .action-buttons { flex-direction: column; }
    .number-grid { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 5px; }
    .grid-number { height: 40px; }
    .number-circle { width: 35px; height: 35px; font-size: 0.9rem; }
    .set-label { display: none; }

    .mode-btn {
        position: fixed;
        bottom: 20px;
        right: 20px;
        top: auto;
        padding: 12px;
        border-radius: 50%;
        z-index: 9999;
    }

    .mode-btn #mode-text {
        display: none;
    }
}

/* --- 이 주의 당첨 섹션 --- */
#weekly-winners-container {
    background-color: var(--card-bg);
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

#weekly-winners-container .sidebar-title {
    color: var(--accent-color);
    border-bottom: none;
}

.winning-numbers-box {
    padding: 10px;
    margin-bottom: 15px;
    background-color: var(--bg-color);
    border-radius: 8px;
    text-align: center;
}

#user-winning-list .feed-item {
    border-left: 3px solid var(--secondary-color);
}

#user-winning-list p {
    text-align: center;
    color: #888;
}

/* 당첨 정보 테이블 스타일 조정 */
.details-table tbody tr td:nth-child(2) {
    white-space: nowrap;
}

/* 금주의 당첨 정보 섹션의 번호 공 스타일 조정 */
#winning-numbers-of-the-week .number-circle {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
}

#winning-numbers-of-the-week .lotto-balls-container {
    justify-content: space-between;
}
