/* Global Styles */
:root {
    --primary-color: #FFD700;
    --primary-light: #FFF9E6;
    --text-color: #333333;
    --border-color: #E0E0E0;
    --background-color: #FFFFFF;
}

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

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    top: 0 !important;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Navbar */
.navbar {
    background: var(--background-color);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 9999;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Utility navigation */
.utility-nav {
    background: white;
}

.utility-nav .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0.3rem 2rem;
}

/* Custom language dropdown */
.language-select {
    position: relative;
}

.lang-dropdown {
    position: relative;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.lang-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.lang-trigger:hover {
    border-color: #FFD700;
    box-shadow: 0 2px 6px rgba(255,215,0,0.25);
}

.lang-dropdown.open .lang-trigger {
    border-color: #FFD700;
    box-shadow: 0 2px 6px rgba(255,215,0,0.3);
}

.lang-flag-img {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    flex-shrink: 0;
}

.lang-chevron {
    color: #888;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.lang-dropdown.open .lang-chevron {
    transform: rotate(180deg);
}

.lang-options {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    list-style: none;
    padding: 6px;
    min-width: 150px;
    z-index: 9999;
}

.lang-dropdown.open .lang-options {
    display: block;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: background 0.12s;
}

.lang-option:hover {
    background: #FFF9E6;
}

.lang-option.active {
    background: #FFF3CC;
    font-weight: 600;
    color: #b8860b;
}

/* Top navigation */
.top-nav {
    background: var(--background-color);
    border-bottom: 1px solid var(--border-color);
}

.top-nav .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0.5rem 2rem;
}

/* Main navigation */
.main-nav {
    background: var(--background-color);
    border-bottom: 1px solid var(--border-color);
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 1rem 2rem;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 80px;
    width: auto;
}

.logo a {
    display: block;
    text-decoration: none;
}

.logo a:hover {
    opacity: 0.9;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    margin: 45px 0 0 0;
    padding: 0;
    align-items: center;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.2rem;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0.5rem 0;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

.nav-links .dropdown {
    position: relative;
}

.nav-links .dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: white;
    min-width: 160px;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.nav-links .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-links .dropdown-menu li {
    padding: 0;
}

.nav-links .dropdown-menu a {
    padding: 0.8rem 1.5rem;
    display: block;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    font-size: 0.95rem;
}

.nav-links .dropdown-menu a:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.nav-links .dropdown-menu a::after {
    display: none;
}

/* Remove the dropdown arrow */
.nav-links .dropdown > a::after {
    display: none;
}

/* Hero Section */
.hero-section {
    background-color: var(--primary-color);
    padding: 8rem 0 4rem;
    text-align: center;
    position: relative;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.9;
}

/* Main Content Section */
.main-content {
    padding: 3rem 0;
    background: var(--background-color);
}

.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-title h2 {
    font-size: 2.2rem;
    color: var(--text-color);
    margin-bottom: 0.8rem;
}

.section-title p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.worksheet-section {
    max-width: 1200px;
    margin: 0 auto 3rem;
    padding: 0 2rem;
}

.worksheet-section-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1.4rem;
    padding-bottom: 0.7rem;
    border-bottom: 2px solid;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.worksheet-section-header i {
    font-size: 1.1rem;
}

.english-section-header {
    color: #3a7bd5;
    border-color: #3a7bd5;
}

.math-section-header {
    color: #e07b2a;
    border-color: #e07b2a;
}

.puzzle-section-header {
    color: #7b5ea7;
    border-color: #7b5ea7;
}

.template-section-header {
    color: #3a9a6e;
    border-color: #3a9a6e;
}

/* Coming Soon cards */
.coming-soon-thumb {
    width: 100%;
    aspect-ratio: 4/3;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.6rem;
    font-size: 2.5rem;
    color: #ccc;
}

.coming-soon-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: #f0f0f0;
    color: #999;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 0.3rem;
}

.worksheet-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.4rem;
}

.worksheet-card {
    background: white;
    border-radius: 12px;
    padding: 0.8rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.worksheet-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.worksheet-card.disabled {
    opacity: 0.6;
    filter: grayscale(0.3);
}

.worksheet-card.disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.worksheet-card img {
    width: 100%;
    height: auto;
    margin-bottom: 0.6rem;
    border-radius: 8px;
}

.worksheet-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.worksheet-card p {
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    line-height: 1.5;
    font-size: 0.95rem;
}

.create-btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background-color: #FFD700;
    color: #333;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: background-color 0.2s ease;
    font-size: 1.05rem;
}

.create-btn:hover {
    background-color: #FFB700;
}

.coming-soon {
    display: inline-block;
    padding: 0.9rem 2.2rem;
    background-color: #f5f5f5;
    color: #999;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    cursor: not-allowed;
    font-size: 1.05rem;
}

/* Features Section */
.features-section {
    padding: 4rem 0;
    background: var(--primary-light);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 0 auto;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.feature-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-color);
    opacity: 0.8;
}

/* Footer */
footer {
    background: white;
    padding: 4rem 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.footer-about {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-logo-img {
    height: 60px;
    margin-bottom: 2rem;
}

.footer-about p {
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 1rem;
    margin-top: 1rem;
}

.footer-nav h3 {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-nav-list {
    list-style: none;
    padding: 0;
}

.footer-nav-list li {
    margin-bottom: 0.5rem;
}

.footer-nav-list a {
    color: var(--text-color);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

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

.footer-contact {
    text-align: left;
}

.footer-contact h3 {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-contact a {
    color: var(--text-color);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-contact a:hover {
    opacity: 1;
    color: var(--primary-color);
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-color);
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .worksheet-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .worksheet-section {
        padding: 0 1.5rem;
    }
}

/* Hamburger Button */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
    background: none;
    border: none;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Nav Drawer */
.mobile-nav {
    display: none;
    flex-direction: column;
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 0.5rem 0 1rem;
}

.mobile-nav.open {
    display: flex;
}

.mobile-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    display: block;
}

.mobile-nav a:last-child {
    border-bottom: none;
}

.mobile-nav a:hover {
    background: var(--primary-light);
    color: #b8960a;
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    /* Header: 로고 + 햄버거 가로 배치 */
    .main-header .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }

    .main-header .logo-img {
        height: 52px;
    }

    .site-description {
        display: none;
    }

    /* 상단 nav 숨기고 햄버거 보이기 */
    .top-menu .nav-links {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    /* 카드 그리드 */
    .worksheet-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .worksheet-section {
        padding: 0 1rem;
        margin-bottom: 2rem;
    }

    .worksheet-types {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-about {
        align-items: center;
    }

    .footer-nav-list {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .worksheet-grid {
        grid-template-columns: 1fr;
    }
    .worksheet-section {
        padding: 0 0.75rem;
    }

    .main-header {
        padding: 0.75rem 0;
    }
}

/* Google Translate Styles */
#google_translate_element {
    padding: 0;
}

.goog-te-gadget {
    font-family: 'Arial', sans-serif !important;
    color: #333 !important;
}

.goog-te-gadget .goog-te-combo {
    padding: 6px 28px 6px 10px;
    border: 2px solid #FFD700;
    border-radius: 20px;
    background-color: white;
    color: #333;
    font-size: 14px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    cursor: pointer;
    margin: 0 !important;
    min-width: 160px;
}

.goog-te-gadget .goog-te-combo:hover {
    border-color: #FFB700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.goog-te-gadget .goog-te-combo:focus {
    outline: none;
    border-color: #FF9700;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Hide Google Translate attribution */
.goog-te-gadget-simple {
    border: none !important;
}

.goog-te-banner-frame {
    display: none;
}

.goog-te-gadget span {
    display: none;
}

/* Top Menu */
.top-menu {
    background: #FFF9E6;
    padding: 0.8rem 0;
}

.top-menu .container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.top-menu .nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.top-menu .nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.top-menu .nav-links a:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #FFD700;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.top-menu .nav-links a:hover:after {
    transform: scaleX(1);
}

.top-menu .nav-links a:hover {
    color: #FFD700;
}

/* Main Header with Logo and Description */
.main-header {
    background: var(--background-color);
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.main-header .container {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.main-header .logo {
    flex-shrink: 0;
}

.main-header .logo-img {
    height: 80px;
    width: auto;
}

.site-description {
    flex-grow: 1;
}

.site-description h1,
.site-description .site-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.site-description p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media print {
    /* Hide non-printable elements */
    .controls, .preview-actions, .word-input {
        display: none !important;
    }

    /* Show only the preview content */
    .preview-container {
        position: static !important;
        overflow: visible !important;
        height: auto !important;
    }

    /* Maintain spacing in print */
    .sentence-item.spacing-compact {
        margin-bottom: 1rem !important;
    }
    
    .sentence-item.spacing-normal {
        margin-bottom: 2rem !important;
    }
    
    .sentence-item.spacing-wide {
        margin-bottom: 3rem !important;
    }

    /* Ensure proper page breaks */
    .sentence-item {
        page-break-inside: avoid;
    }
} 