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

:root {
    --primary-black: #121212;
    --secondary-black: #2a2a2a;
    --primary-gray: #666;
    --light-gray: #e5e5e5;
    --background: #fafafa;
    --accent: #c9302c;
    --text-primary: #333;
    --text-secondary: #666;
}

body {
    font-family: 'Source Sans Pro', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
}

/* Header Styles */
header {
    background-color: white;
    border-bottom: 1px solid var(--primary-black);
}

.header-top {
    border-bottom: 1px solid var(--light-gray);
    padding: 0.5rem 0;
}

.header-meta {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.edition {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-main {
    text-align: center;
    padding: 2rem 0;
}

.header-main h1 {
    font-family: 'Playfair Display', serif;
    font-size: 4.5rem;
    font-weight: 900;
    letter-spacing: -2px;
    color: var(--primary-black);
    text-transform: uppercase;
}

.header-border {
    width: 100px;
    height: 3px;
    background-color: var(--primary-black);
    margin: 1rem auto;
}

.tagline {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-style: italic;
    font-weight: 300;
}

.header-nav {
    background-color: var(--primary-black);
    color: white;
    padding: 0;
}

.header-nav > div {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-items {
    display: flex;
    gap: 2rem;
}

.nav-item {
    padding: 1rem 0;
    cursor: pointer;
    transition: color 0.2s;
    font-weight: 400;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.nav-item:hover,
.nav-item.active {
    color: var(--accent);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pdf-download-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-black);
    color: white;
    border: 1px solid var(--primary-black);
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-download-btn:hover {
    background: transparent;
    color: var(--primary-black);
}

.pdf-download-btn svg {
    width: 20px;
    height: 20px;
}

.pdf-download-btn svg.spinning {
    animation: spin 1s linear infinite;
}

/* Language Toggle Button */
.lang-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-black);
    border: 1px solid var(--primary-black);
    color: white;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-toggle-btn:hover {
    background: var(--primary-black);
    color: white;
    opacity: 0.8;
}

.lang-toggle-btn svg {
    width: 20px;
    height: 20px;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Toast notification */
.toast-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.toast-notification.show {
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.125rem;
    font-weight: 500;
}

.toast-content svg {
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

.last-updated {
    font-size: 0.813rem;
    color: #ccc;
}

/* Main Content */
main {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 2rem;
}

/* Podcast Banner */
.podcast-banner {
    background: white;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    margin-bottom: 2rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.podcast-banner:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.podcast-banner .podcast-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    height: 100px;
}

.podcast-banner .podcast-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    flex-shrink: 0;
}

.podcast-banner .podcast-content {
    flex: 1;
    padding: 1rem 1.5rem;
}

.podcast-banner .podcast-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-black);
    margin-bottom: 0.25rem;
}

.podcast-banner .podcast-content p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Korean Podcast Banner for non-Apple devices */
.podcast-banner-ko-no-apple {
    background: white;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    margin-bottom: 2rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
    display: none; /* Hidden by default */
}

.podcast-banner-ko-no-apple:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.podcast-banner-ko-no-apple .podcast-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    height: 100px;
}

.podcast-banner-ko-no-apple .podcast-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    flex-shrink: 0;
}

.podcast-banner-ko-no-apple .podcast-content {
    flex: 1;
    padding: 1rem 1.5rem;
}

.podcast-banner-ko-no-apple .podcast-content h2 {
    font-family: 'Nanum Gothic', 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-black);
    margin-bottom: 0.25rem;
}

.podcast-banner-ko-no-apple .podcast-content p {
    font-family: 'Nanum Gothic', sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

.loading {
    text-align: center;
    font-size: 1.125rem;
    color: var(--text-secondary);
    padding: 4rem;
    font-style: italic;
}

/* Log container styles */
.log-container {
    background: white;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.log-header {
    background: var(--primary-black);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px 8px 0 0;
}

.log-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
}

.log-progress {
    width: 100%;
    height: 4px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
}

.log-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #ff6b6b, var(--accent));
    background-size: 200% 100%;
    animation: progressShimmer 2s linear infinite;
    width: 0%;
    transition: width 0.3s ease;
}

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

.log-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    background: #f8f9fa;
}

.log-entry {
    margin-bottom: 0.25rem;
    padding: 0.25rem 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.log-entry.start { color: #2563eb; font-weight: 600; }
.log-entry.category { color: #7c3aed; font-weight: 600; }
.log-entry.search { color: #0891b2; }
.log-entry.success { color: #059669; }
.log-entry.warning { color: #d97706; }
.log-entry.error { color: #dc2626; }
.log-entry.complete { color: #059669; font-weight: 600; }
.log-entry.info { color: var(--text-secondary); }

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    transition: opacity 0.3s ease;
}

.news-grid.filtering {
    opacity: 0.5;
}

/* Feature first article */
.news-item:first-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    border-bottom: 2px solid var(--primary-black);
    margin-bottom: 2rem;
}

.news-item {
    background: white;
    border: 1px solid var(--light-gray);
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-color: var(--accent);
}

.news-item:active {
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.news-item h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.2;
    color: var(--primary-black);
}

.news-item:first-child h2 {
    font-size: 2.5rem;
    line-height: 1.1;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.813rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-source {
    font-weight: 600;
    color: var(--accent);
}

.news-summary {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* News card click indicator */
.news-item::after {
    content: '';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 6px;
    height: 6px;
    background-color: var(--accent);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.news-item:hover::after {
    opacity: 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    overflow-y: auto;
    padding: 2rem;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 3rem;
    max-width: 800px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
    position: relative;
}

.close {
    position: absolute;
    right: 2rem;
    top: 2rem;
    font-size: 2rem;
    font-weight: 300;
    color: var(--primary-gray);
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: var(--primary-black);
}

.modal h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    line-height: 1.2;
    color: var(--primary-black);
}

.modal-section {
    margin-bottom: 2rem;
}

.modal-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-black);
    border-bottom: 2px solid var(--primary-black);
    padding-bottom: 0.5rem;
}

.modal-section p {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1.125rem;
}

.modal-section ul {
    list-style: none;
}

.modal-section li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.modal-section li:before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

.modal-footer {
    margin-top: 2.5rem;
    text-align: center;
    border-top: 1px solid var(--light-gray);
    padding-top: 2rem;
}

.modal-footer .read-more {
    display: inline-block;
    padding: 1rem 3rem;
    background-color: var(--primary-black);
    color: white;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.modal-footer .read-more:hover {
    background-color: var(--accent);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .news-item:first-child {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-main h1 {
        font-size: 3rem;
    }

    .nav-items {
        display: none;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .news-item:first-child {
        padding: 1.5rem;
    }

    .news-item h2 {
        font-size: 1.5rem;
    }

    .news-item:first-child h2 {
        font-size: 2rem;
    }

    .modal-content {
        padding: 2rem;
        margin: 1rem;
    }

    .modal h2 {
        font-size: 1.75rem;
    }

    .podcast-banner .podcast-content h2 {
        font-size: 1.25rem;
    }

    .podcast-banner .podcast-content p {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .header-main h1 {
        font-size: 2.5rem;
    }

    .header-meta {
        padding: 0 1rem;
    }

    main {
        padding: 0 1rem;
    }

    .modal-content {
        padding: 1.5rem;
        margin: 0.5rem;
    }

    .podcast-banner .podcast-content {
        padding: 1rem;
    }

    .podcast-banner .podcast-content h2 {
        font-size: 1.125rem;
    }

    .podcast-banner .podcast-content p {
        font-size: 0.813rem;
    }
}

/* Footer Styles */
footer {
    background-color: var(--primary-black);
    color: white;
    padding: 3rem 0;
    margin-top: 5rem;
    text-align: center;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content p {
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    transition: opacity 0.2s ease;
    border-bottom: 1px solid transparent;
}

.footer-links a:hover {
    opacity: 0.8;
    border-bottom-color: white;
}

.footer-copyright {
    font-size: 0.875rem;
    color: #999;
    margin-bottom: 0 !important;
}

/* Admin Login Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-black);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    font-size: 1rem;
    font-family: 'Source Sans Pro', sans-serif;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-black);
}

#adminLoginForm button {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-black);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#adminLoginForm button:hover {
    background-color: var(--primary-black-hover);
}