* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --light-gray-color: #f4f4f4;
    --gray-color: #ddd;
    --dark-gray-color: #888;
    --background-color: #ffffff;
    --text-color: #333;
    --view-bg-color: #ffffff;
    --input-bg-color: #ffffff;
    --border-color: #ddd;
    --ai-bg-color: #e8f4fd;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body.dark-mode {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --light-gray-color: #2c3e50;
    --gray-color: #555;
    --dark-gray-color: #999;
    --background-color: #1a1a1a;
    --text-color: #ecf0f1;
    --view-bg-color: #222;
    --input-bg-color: #333;
    --border-color: #444;
    --ai-bg-color: #34495e;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

header {
    width: 100%;
    text-align: center;
    padding: 20px;
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

#dark-mode-toggle {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.5);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 40px;
    transition: all 0.2s ease;
}

#dark-mode-toggle:hover {
    background: rgba(255,255,255,0.4);
}

nav {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

nav button {
    background-color: transparent;
    border: 2px solid white;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

nav button:hover, nav button.active {
    background-color: white;
    color: var(--primary-color);
}

.view {
    width: 90%;
    max-width: 600px;
    margin-top: 30px;
    padding: 20px;
    background-color: var(--view-bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: none; /* 기본적으로 숨김 */
    transition: background-color 0.3s;
}

.view.active {
    display: block; /* 활성화된 뷰만 보임 */
}

.view h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.list-subtitle {
    text-align: left;
    font-size: 1.2rem;
    font-weight: 500;
    margin-top: 25px;
    margin-bottom: 10px;
    color: var(--text-color);
    padding-bottom: 5px;
    border-bottom: 2px solid var(--border-color);
    transition: color 0.3s, border-color 0.3s;
}

.list-container {
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.destination-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.destination-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--light-gray-color);
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.destination-list li span {
    flex-grow: 1;
}

.destination-list li.highlight {
    background-color: var(--secondary-color);
    color: white;
    font-weight: 700;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--dark-gray-color);
    cursor: pointer;
    font-size: 1rem;
    margin-left: 10px;
    transition: color 0.3s;
}
.delete-btn:hover {
    color: #e74c3c;
}

.edit-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.edit-form input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg-color);
    color: var(--text-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.edit-form button {
    padding: 10px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

.result-container {
    text-align: center;
    margin: 20px 0;
}

.result-container p {
    font-size: 1.1rem;
    color: var(--dark-gray-color);
    transition: color 0.3s;
}

.result-text {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 10px;
    min-height: 40px;
}

.result-text.winner {
    transform: scale(1.2);
    color: var(--secondary-color);
    transition: all 0.3s ease;
}

.picker-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.3rem;
    font-weight: 700;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s;
}

.picker-btn:disabled {
    background-color: var(--gray-color);
    cursor: not-allowed;
}

/* 로또 번호 스타일 */
.lotto-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.lotto-ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.lotto-ball.highlight {
    transform: scale(1.2);
}

footer {
    width: 100%;
    text-align: center;
    padding: 20px;
    margin-top: auto;
    color: var(--dark-gray-color);
    transition: color 0.3s;
}

footer a {
    color: var(--dark-gray-color);
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    text-decoration: underline;
}

/* Confetti Animation */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f00; /* Will be overridden by JS */
    opacity: 0;
    animation: burst 1s ease-out forwards;
}

@keyframes burst {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--x), var(--y)) rotate(720deg) scale(0);
    }
}