:root {
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --container-bg: rgba(255, 255, 255, 0.8);
    --primary-color: #3b82f6;
    --accent-color: #8b5cf6;
    --circle-text: #fff;
    --btn-bg: #e2e8f0;
    --btn-text: #1e293b;
    --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08);
    --header-bg: rgba(255, 255, 255, 0.7);
    --badge-bg: linear-gradient(135deg, #e0e7ff, #dbeafe);
    --badge-text: #3730a3;
    --glass-border: 1px solid rgba(255, 255, 255, 0.4);
}

.dark-mode {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --container-bg: rgba(30, 41, 59, 0.7);
    --primary-color: #60a5fa;
    --accent-color: #a78bfa;
    --circle-text: #fff;
    --btn-bg: #334155;
    --btn-text: #f1f5f9;
    --card-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4);
    --header-bg: rgba(15, 23, 42, 0.7);
    --badge-bg: linear-gradient(135deg, #312e81, #1e3a8a);
    --badge-text: #e0e7ff;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding-top: 80px;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,0) 0, hsla(253,16%,7%,0) 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0.1) 0, hsla(225,39%,30%,0) 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0.1) 0, hsla(339,49%,30%,0) 50%);
    color: var(--text-color);
    transition: background-color 0.4s ease, color 0.4s ease;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* Header & Navigation */
.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: var(--glass-border);
    z-index: 1000;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 24px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    opacity: 0.8;
}

.nav-links a:hover {
    color: var(--primary-color);
    opacity: 1;
}

#theme-toggle {
    background: var(--btn-bg);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 12px;
    color: var(--btn-text);
    transition: transform 0.2s ease, background 0.2s ease;
}

#theme-toggle:hover {
    transform: rotate(15deg);
    background: var(--badge-bg);
}

/* Main Layout */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Hero Section with Aha Moment */
.hero-section {
    text-align: center;
    padding: 100px 20px;
    position: relative;
    overflow: hidden;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
    line-height: 1.1;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color), var(--primary-color));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientMove 5s linear infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.hero-section p {
    font-size: 1.3rem;
    opacity: 0.8;
    max-width: 650px;
    margin: 0 auto;
    font-weight: 400;
}

/* Card Style Sections with Glassmorphism */
.card {
    background-color: var(--container-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 32px;
    padding: 50px;
    margin-bottom: 50px;
    box-shadow: var(--card-shadow);
    border: var(--glass-border);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card:hover {
    transform: translateY(-5px);
}

.badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--badge-bg);
    color: var(--badge-text);
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.content-text {
    margin-bottom: 40px;
    text-align: left;
    color: var(--text-color);
    opacity: 0.9;
    font-size: 1.05rem;
}

/* Lotto styling with 3D feel */
.lotto-display-area {
    background: var(--btn-bg);
    padding: 40px;
    border-radius: 24px;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.lotto-numbers {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    min-height: 70px;
}

.lotto-number {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8), rgba(255,255,255,0) 25%), 
                linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 800;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3), inset 0 -5px 10px rgba(0,0,0,0.2);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes popIn {
    0% { transform: scale(0) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* New: Lotto Rolling Animation Class */
.lotto-number.rolling {
    animation: roll 0.1s linear infinite;
    background: var(--btn-bg);
    color: var(--text-color);
    box-shadow: none;
    border: 2px solid var(--primary-color);
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    text-align: left;
}

.detail-item {
    padding: 24px;
    background: rgba(255, 255, 255, 0.5);
    border: var(--glass-border);
    border-radius: 20px;
}

.dark-mode .detail-item {
    background: rgba(0, 0, 0, 0.2);
}

.detail-item h3 {
    font-size: 1.1rem;
    margin-top: 0;
    color: var(--primary-color);
}

/* AI section styles with Scan Effect */
.upload-box {
    border: 2px dashed var(--accent-color);
    border-radius: 24px;
    padding: 60px 40px;
    cursor: pointer;
    background-color: rgba(255,255,255,0.05);
    position: relative;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    overflow: hidden;
}

.upload-box:hover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* AI Scanning Effect */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color), 0 0 30px var(--primary-color);
    animation: scanning 2s linear infinite;
    display: none; /* Controlled by JS */
    z-index: 20;
}

@keyframes scanning {
    0% { top: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.image-preview-wrapper {
    position: relative;
    width: 100%;
    max-height: 400px;
    display: flex;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
}

#image-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: none;
}

.ai-status {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    display: none;
    z-index: 30;
    white-space: nowrap;
}

/* Prediction Results with Progress Bars */
.prediction-container {
    margin-top: 30px;
    display: grid;
    gap: 16px;
}

.prediction-item {
    background: var(--btn-bg);
    padding: 15px 20px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.prediction-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.progress-bar-bg {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--badge-bg), var(--primary-color));
    opacity: 0.2;
    width: 0%;
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.prediction-item.highlight .progress-bar-bg {
    background: var(--primary-color);
    opacity: 0.3;
}

.prediction-item.highlight {
    border: 2px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.2);
}

/* Main Button with Glow */
.main-btn {
    padding: 20px 50px;
    font-size: 1.2rem;
    border: none;
    border-radius: 100px;
    background: linear-gradient(135deg, var(--text-color), #475569);
    color: var(--bg-color);
    font-weight: 800;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.main-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.main-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.main-btn:hover::after {
    left: 100%;
}

.main-btn:active {
    transform: scale(0.98);
}

/* Form Styling - Restored */
.form-group {
    margin-bottom: 24px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 18px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

/* Footer Styling */
.site-footer {
    text-align: center;
    padding: 80px 20px;
    background-color: var(--btn-bg);
    margin-top: 80px;
    border-top: var(--glass-border);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .hero-section h1 {
        font-size: 2.5rem;
    }
    .card {
        padding: 30px 20px;
        border-radius: 24px;
    }
}

/* Naver Blog Style Feed Layout - Mobile Optimized */
.naver-style {
    background-color: #f2f4f7;
    padding-top: 100px; /* Reduced for mobile */
}

.naver-header {
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tab-nav {
    border-top: 1px solid #f2f4f7;
    overflow-x: auto;
    background: #fff;
    -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
    scrollbar-width: none; /* Hide scrollbar for Chrome/Safari */
    position: relative;
    display: flex; /* For indicator positioning */
}

.tab-nav::after {
    content: '';
    position: sticky;
    right: 0;
    top: 0;
    min-width: 50px;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), #fff);
    pointer-events: none; /* Allow clicking through the fade */
    z-index: 10;
    margin-left: -50px; /* Overlay on top of the list */
}

.dark-mode .tab-nav::after {
    background: linear-gradient(to right, rgba(13, 17, 23, 0), #0d1117);
}

.tab-nav::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.tab-list {
    display: flex;
    list-style: none;
    padding: 0 10px;
    margin: 0 auto;
    max-width: 900px;
    white-space: nowrap;
}

.tab-list li a {
    display: block;
    padding: 12px 12px;
    text-decoration: none;
    color: #666;
    font-weight: 700;
    font-size: 0.9rem;
    position: relative;
    transition: color 0.2s;
}

.tab-list li a.active {
    color: var(--primary-color);
}

.tab-list li a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

.feed-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
}

.featured-engine {
    background: linear-gradient(to bottom, #ffffff, #f8faff);
    margin-bottom: 24px;
    text-align: center;
    border: 1px solid rgba(59, 130, 246, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.featured-engine h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.featured-engine p {
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 24px;
}

.post-card {
    background: #fff;
    border-radius: 16px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.post-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    border-color: rgba(59, 130, 246, 0.1);
}

.post-card:active {
    transform: scale(0.99);
    background: #fcfcfc;
}

.post-link {
    text-decoration: none;
    color: inherit;
    display: block;
    padding: 24px;
}

.post-content {
    display: flex;
    gap: 24px;
    justify-content: space-between;
    align-items: flex-start;
}

.post-info {
    flex: 1;
}

.category {
    font-size: 0.7rem;
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 10px;
    display: inline-block;
    padding: 2px 8px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.post-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 0 12px 0;
    line-height: 1.45;
    color: #111827;
    letter-spacing: -0.025em;
}

.post-excerpt {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-thumbnail {
    width: 110px;
    height: 110px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

.post-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #6b7280;
}

.author {
    font-weight: 700;
    color: #374151;
}

.dot { margin: 0 8px; opacity: 0.5; }

.dark-mode .post-card { border-color: rgba(255, 255, 255, 0.05); }
.dark-mode .post-title { color: #f3f4f6; }
.dark-mode .post-excerpt { color: #9ca3af; }
.dark-mode .category { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.dark-mode .post-footer { border-top-color: #30363d; color: #8b949e; }
.dark-mode .author { color: #c9d1d9; }

@media (max-width: 600px) {
    .post-content { flex-direction: column-reverse; gap: 16px; }
    .post-thumbnail { width: 100%; height: 180px; }
    .post-title { font-size: 1.2rem; }
    .post-link { padding: 20px; }
    .feed-container { padding: 12px; }
}

/* Naver Style Footer Fix */
.naver-footer {
    background: #fff;
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid #eee;
    margin-top: 40px;
}

.naver-footer .footer-links {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.naver-footer .footer-links a {
    text-decoration: none;
    color: #666;
    font-size: 0.85rem;
    font-weight: 600;
}

.naver-footer .copyright {
    font-size: 0.8rem;
    color: #999;
    margin: 0;
}

.dark-mode .naver-footer {
    background-color: #0d1117;
    border-top-color: #30363d;
}

.dark-mode .naver-footer .footer-links a {
    color: #8b949e;
}

