@import url('https://fonts.googleapis.com/css2?family=Pretendard:wght@400;600;800&display=swap');

:root {
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --panel-bg: rgba(255, 255, 255, 0.7);
    --panel-border: rgba(255, 255, 255, 0.5);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --blob-1: rgba(139, 92, 246, 0.2);
    --blob-2: rgba(236, 72, 153, 0.15);
    --nav-bg: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --panel-bg: rgba(255, 255, 255, 0.03);
    --panel-border: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --blob-1: rgba(139, 92, 246, 0.5);
    --blob-2: rgba(236, 72, 153, 0.4);
    --nav-bg: rgba(15, 23, 42, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Pretendard', sans-serif;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background: var(--bg-gradient);
    overflow-y: auto;
    position: relative;
    padding-top: 80px; /* Space for nav */
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 1000;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(to right, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0.8;
}

.nav-link:hover {
    opacity: 1;
    color: #ec4899;
}

/* Footer */
.footer {
    width: 100%;
    padding: 3rem 5%;
    background: var(--panel-bg);
    border-top: 1px solid var(--panel-border);
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-copy {
    color: var(--text-secondary);
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Content Sections */
.article-section {
    width: 90%;
    max-width: 800px;
    margin-top: 2rem;
    padding: 2.5rem;
    line-height: 1.8;
}

.article-title {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.article-content p {
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
}

.article-content h3 {
    color: var(--text-primary);
    margin: 2rem 0 1rem;
}

.container {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 500px;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.glass-panel {
    background: var(--panel-bg);
    border-radius: 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    box-shadow: 0 25px 50px -12px var(--shadow-color);
}

.theme-toggle {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.title {
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    background: linear-gradient(to right, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    text-align: center;
    margin-bottom: 1rem;
}

.balls-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    min-height: 80px;
    width: 100%;
    perspective: 1000px;
}

.placeholder {
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    height: 60px;
}

.lotto-ball {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    box-shadow: 
        inset -5px -5px 15px rgba(0,0,0,0.3),
        inset 5px 5px 15px rgba(255,255,255,0.4),
        0 10px 20px rgba(0,0,0,0.3);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    opacity: 0;
    transform: rotateY(-90deg) scale(0.5);
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    to {
        opacity: 1;
        transform: rotateY(0) scale(1);
    }
}

.ball-yellow { background: linear-gradient(135deg, #fcd34d 0%, #d97706 100%); }
.ball-blue { background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%); }
.ball-red { background: linear-gradient(135deg, #f87171 0%, #dc2626 100%); }
.ball-gray { background: linear-gradient(135deg, #9ca3af 0%, #4b5563 100%); }
.ball-green { background: linear-gradient(135deg, #34d399 0%, #059669 100%); }

.generate-btn {
    position: relative;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 9999px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    max-width: 300px;
    margin-top: 1rem;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(236, 72, 153, 0.5);
}

.generate-btn:active {
    transform: translateY(1px);
}

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    z-index: 1;
}

.generate-btn:hover .btn-glow {
    animation: shine 1.5s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 200%; }
}
