@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&family=Source+Sans+Pro:wght@400;700&display=swap');

/* ===================================
   BASE STYLES
====================================== */
:root {
    --font-family-base: "NanumBarunGothic", sans-serif;

    /* Light Theme */
    --bg-color-light: #F4F7FC;
    --card-bg-light: #FFFFFF;
    --text-color-light: #1C1E21;
    --sub-text-light: #606770;
    --border-color-light: #EAEBEE;
    --accent-color-light: #4A90E2;
    --shadow-light: 0 12px 30px rgba(0, 0, 0, 0.08);

    /* Dark Theme */
    --bg-color-dark: #0F0F1A;
    --card-bg-dark: #1A1A2E;
    --text-color-dark: #EAEAEA;
    --sub-text-dark: #9090A0;
    --border-color-dark: #2A2A4A;
    --accent-color-dark: #6C63FF;
    --shadow-dark: 0 12px 35px rgba(0, 0, 0, 0.25);

    /* Lotto Ball Colors */
    --ball-yellow: #fbc400;
    --ball-blue: #69c8f2;
    --ball-red: #ff7272;
    --ball-gray: #aaaaaa;
    --ball-green: #b0d840;
}

[data-theme="light"] {
    --bg-color: var(--bg-color-light);
    --card-bg: var(--card-bg-light);
    --text-color: var(--text-color-light);
    --sub-text: var(--sub-text-light);
    --border-color: var(--border-color-light);
    --accent-color: var(--accent-color-light);
    --shadow: var(--shadow-light);
}

[data-theme="dark"] {
    --bg-color: var(--bg-color-dark);
    --card-bg: var(--card-bg-dark);
    --text-color: var(--text-color-dark);
    --sub-text: var(--sub-text-dark);
    --border-color: var(--border-color-dark);
    --accent-color: var(--accent-color-dark);
    --shadow: var(--shadow-dark);
}

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

body {
    font-family: var(--font-family-base);
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center; /* Changed from flex-start to center */
    padding: 0.75rem 1rem; /* Reduced from 1.5rem */
    transition: background-color 0.4s ease, color 0.4s ease;
}

.container {
    width: 100%;
    max-width: 700px;
    background: var(--card-bg);
    border-radius: 24px;
    padding: 0.5rem; /* Reduced from 0.75rem */
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.4s ease;
}

h1 {
    font-weight: 900;
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
    letter-spacing: -1.5px;
}



/* ===================================
   BUTTONS
====================================== */
.btn-base {
    color: white;
    border: none;
    padding: 0.8rem 1.7rem; /* Halved padding */
    font-size: 1rem;   /* Halved font size */
    font-weight: 700;
    border-radius: 100px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s, background-position 0.4s;
    background-size: 200% auto;
    margin: 1rem 0;
}

.btn-generate {
    background-image: linear-gradient(to right, #6C63FF, #4834d4, #6C63FF);
    box-shadow: 0 5px 20px rgba(108, 99, 255, 0.4);
}



.btn-base:hover {
    background-position: right center; /* change the direction of the change here */
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}

.btn-base:active {
    transform: translateY(0);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}



/* Adjust the share buttons container to remove top margin/border if it's now part of the flex layout */
.share-buttons-container {
    margin: 0; /* Remove vertical margin */
    padding-top: 0; /* Remove top padding */
    border-top: none; /* Remove top border */
    display: flex; /* Make it a flex container itself to align its content */
    flex-direction: column; /* Stack text and buttons vertically */
    align-items: center; /* Center content horizontally */
    gap: 0.5rem; /* Space between text and button group */
}
.share-buttons-container p {
    margin-bottom: 0; /* Remove bottom margin from paragraph */
}

/* ===================================
   SECTIONS
====================================== */
.options-container {
    display: flex;
    flex-direction: column; /* Stack bonus and fixed/share wrapper vertically */
    align-items: center; /* Center items horizontally */
    gap: 1.5rem; /* Space between bonus and fixed/share wrapper */
    margin: 1.25rem 0; /* Reduced from 2.5rem 0 */
    padding: 1rem 0; /* Reduced from 2rem 0 */
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.fixed-and-share-wrapper {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: center; /* Center items horizontally */
    align-items: flex-start; /* Align items to the top (fixed-numbers-container is taller) */
    gap: 2rem; /* Space between fixed numbers and share section */
    width: 100%; /* Take full width */
}

.result-section { margin-top: 1.25rem; }

/* ===================================
   BALLS
====================================== */
.ball-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px; /* Reduced from 12px */
    min-height: 70px; /* Changed from 60px */
    padding: 0.75rem 0; /* Reduced from 1.5rem */
}

.ball {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2) inset, 0 4px 6px rgba(0,0,0,0.2);
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
}

.ball:hover { transform: scale(1.1) rotate(5deg); }

.ball.fixed {
    border: 4px solid var(--accent-color);
    box-shadow: 0 0 20px var(--accent-color), 0 3px 6px rgba(0,0,0,0.2) inset;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 15px var(--accent-color), 0 3px 6px rgba(0,0,0,0.2) inset; }
    50% { box-shadow: 0 0 25px var(--accent-color), 0 3px 6px rgba(0,0,0,0.2) inset; }
    100% { box-shadow: 0 0 15px var(--accent-color), 0 3px 6px rgba(0,0,0,0.2) inset; }
}

.ball-1-10  { background-color: var(--ball-yellow); }
.ball-11-20 { background-color: var(--ball-blue); }
.ball-21-30 { background-color: var(--ball-red); }
.ball-31-40 { background-color: var(--ball-gray); }
.ball-41-45 { background-color: var(--ball-green); }

/* ===================================
   OPTIONS & INPUTS
====================================== */
.fixed-numbers-container p strong { font-size: 1.2rem; color: var(--text-color); }

.fixed-number-input {
    width: 52px;
    height: 52px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--sub-text);
    background-color: var(--bg-color);
    border: 2px dashed var(--border-color);
    border-radius: 50%;
    transition: all 0.3s;
    -moz-appearance: textfield; /* Firefox */
}

/* Chrome, Safari, Edge, Opera */
.fixed-number-input::-webkit-outer-spin-button,
.fixed-number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.fixed-number-input:focus {
    outline: none;
    border-color: var(--accent-color);
    color: var(--text-color);
    transform: scale(1.05);
}

.inputs-wrapper {
    display: flex;
    gap: 10px; /* Reduced gap */
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.fixed-input-group {
    display: flex;
    flex-direction: column; /* Stack input and button vertically */
    align-items: center;
    gap: 5px; /* Gap between input and button */
}

.btn-small-generate {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-small-generate:hover {
    background-color: #3a7bd5; /* A darker shade of accent color */
}

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

.bonus-container {
    display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 1.5rem;
}

#includeBonus { transform: scale(1.2); }

/* ===================================
   RESULT CARDS
====================================== */
.card-header {
    display: flex;
    justify-content: center; /* Changed from space-between */
    gap: 1rem; /* Add some gap between title and button */
    align-items: center;
    margin-bottom: 0.5rem; /* Existing margin from card-title */
}

.btn-copy {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.btn-copy:hover {
    background-color: #3a7bd5; /* Darker accent */
    transform: translateY(-2px);
}

.btn-copy.copied {
    background-color: #28a745; /* Green for success */
}

.card {
    background: transparent;
    padding: 0.5rem 0.5rem; /* Reduced significantly from 2rem 1.5rem */
    border-radius: 16px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0; /* Remove margin as it's now on card-header */
}

.card.hot .card-title { color: #FF6B6B; }
.card.cold .card-title { color: #4A90E2; }


.card-desc { font-size: 1rem; color: var(--sub-text); margin-bottom: 0.75rem; }

/* ===================================
   ETC
====================================== */
#storeList {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 2 columns, responsive */
    gap: 20px; /* Gap between grid items */
    padding: 0;
}

#storeList li {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

#storeList li:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.store-info {
    margin-bottom: 10px;
}

.store-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 5px;
}

.store-address {
    font-size: 0.9rem;
    color: var(--sub-text);
}

.map-links {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.map-links a {
    text-decoration: none;
}

.map-link-button {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    transition: all 0.2s ease;
}

.map-link-button.naver {
    background-color: #2DB400; /* Naver Green */
}

.map-link-button.naver:hover {
    background-color: #1A9200;
}

.map-link-button.kakao {
    background-color: #FFCD00; /* Kakao Yellow */
    color: #3C1E1E; /* Dark text for contrast */
}

.map-link-button.kakao:hover {
    background-color: #E6B800;
}

.map-link-button svg {
    margin-right: 5px;
}

#storeAddressesSection { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border-color); }
#storeAddressesSection h2 { font-size: 2rem; margin-bottom: 0.75rem; color: var(--accent-color); }

.analysis-info { margin-top: 1.5rem; font-size: 0.9rem; color: var(--sub-text); line-height: 1.6; }

/* Theme Switcher */
.theme-switcher {
    position: fixed; top: 25px; right: 25px; cursor: pointer; font-size: 1.8rem; background: var(--card-bg); padding: 0.6rem; border-radius: 50%; box-shadow: var(--shadow); display: flex; justify-content: center; align-items: center; z-index: 100;
}

/* ===================================
   RESPONSIVE
====================================== */
@media (max-width: 700px) {
    body { padding: 0.5rem 0.5rem; } /* More compact than PC */
    .container { padding: 0.5rem; } /* Same as PC, or adjust as needed */
    /* h1 and subtitle removed */
    .ball { width: 40px; height: 40px; font-size: 1rem; } /* Smaller balls */
    .fixed-number-input { width: 40px; height: 40px; font-size: 1rem; } /* Smaller inputs */
    .btn-base { padding: 0.8rem 2rem; font-size: 1rem; } /* Smaller buttons */
    .card { padding: 0.5rem 0.5rem; } /* Same as PC */
    .card-title { font-size: 1.5rem; } /* Slightly smaller card titles */

    #storeList {
        grid-template-columns: 1fr; /* Single column for mobile */
    }
    #storeAddressesSection h2 { font-size: 1.5rem; } /* Smaller h2 */
}

/* ===================================
   NAVIGATION
====================================== */
.main-nav {
    display: flex;
    justify-content: center;
    background-color: var(--card-bg);
    padding: 0.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 700px;
}

.nav-link {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--sub-text);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.nav-link.active,
.nav-link:hover {
    color: #fff;
    background-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}




/* ===================================
   FAQ SECTION
====================================== */
.faq-section {
    text-align: left;
    margin-top: 2rem;
    padding: 1.5rem; /* Reduced padding */
    border-top: 1px solid var(--border-color);
}

.faq-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--accent-color);
}

.faq-item {
    margin-bottom: 1.5rem;
}

.faq-item:last-child {
    margin-bottom: 0;
}

.faq-question {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.faq-answer {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--sub-text);
}

/* ===================================
   SHARE BUTTONS
====================================== */
.share-buttons-container {
    margin: 2rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.share-buttons-container p {
    font-size: 1rem;
    color: var(--sub-text);
    margin-bottom: 1rem;
    font-weight: 600;
}
.share-button-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.share-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    height: 52px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0 1.2rem;
    color: white;
    text-decoration: none;
}
.share-button:hover {
    transform: translateY(-3px);
    filter: brightness(90%);
}
.share-button.copy-link {
    background-color: var(--accent-color);
}
.share-button.copy-link svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    margin-right: 8px;
}
.share-button.copy-link .copy-link-text {
    font-weight: 600;
}

/* ===================================
   NEWS & BLOG STYLES (Medium-like)
====================================== */
.news-container, .blog-container {
    padding: 2rem 1rem;
    text-align: left;
}

.blog-post {
    max-width: 680px; /* Typical width for readability */
    margin: 0 auto 3rem auto; /* Center the content column */
}

.blog-post h1, .blog-post h2, .blog-post h3 {
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    margin-top: 2rem;
    color: var(--text-color);
}

.blog-container > h1 { /* The main title on the story page */
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 900;
    text-align: center;
    margin-bottom: 3rem;
}

.blog-post h1 {
    font-size: 2.5rem;
    margin-top: 0;
}

.blog-post h2 {
    font-size: 2rem;
}

.blog-post h3 {
    font-size: 1.5rem;
}

.blog-post p {
    font-family: 'Lora', serif;
    font-size: 1.1rem;
    line-height: 1.8; /* Increased line spacing */
    margin-bottom: 1.5rem;
    color: var(--sub-text);
}

.post-meta {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 0.9rem;
    color: var(--sub-text);
    margin-bottom: 2rem;
    display: block;
}

/* ===================================
   FOOTER SECTION
====================================== */
.footer-section {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.footer-item {
    margin-bottom: 20px;
}

.footer-item h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.footer-item a {
    color: var(--sub-text);
    text-decoration: none;
    font-size: 1rem;
}

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

#contactMessage {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin-bottom: 10px;
    resize: vertical;
}

.btn-submit {
    background-image: linear-gradient(to right, var(--accent-color), #4834d4, var(--accent-color));
    box-shadow: 0 5px 20px rgba(108, 99, 255, 0.4);
}