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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8fafc;
    min-height: 100vh;
}

body.nav-open {
    overflow: hidden;
}

.page-container {
    padding: 20px;
    padding-top: 80px; /* 60px header + 20px padding */
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    padding: 24px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.main-content {
    padding: 24px;
}

.editor-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.textarea-container {
    position: relative;
}

.editable-div {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: border-color 0.2s;
    background-color: #fff;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: break-all;
    overflow-y: auto;
    overflow-x: hidden;
}

.editable-div:empty:before {
    content: attr(data-i18n-placeholder);
    color: #9ca3af;
    pointer-events: none;
}

.editable-div:focus {
    border-color: #4f46e5;
}

/* Header and Navigation Styles */
.site-header {
    background-color: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    
}

.site-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #4f46e5;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    width: 45px;
    height: 45px;
    position: relative;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    content: '';
    display: block;
    background-color: #374151;
    height: 3px;
    width: 25px;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
    position: absolute;
    left: 10px;
}

.hamburger {
    top: 21px;
}

.hamburger::before {
    transform: translateY(-8px);
}

.hamburger::after {
    transform: translateY(8px);
}

body.nav-open .hamburger {
    background-color: transparent;
}

body.nav-open .hamburger::before {
    transform: rotate(45deg);
}

body.nav-open .hamburger::after {
    transform: rotate(-45deg);
}

.side-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    background-color: #fff;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 999;
    padding-top: 80px;
}

.side-nav.active {
    transform: translateX(0);
}

.side-nav ul {
    list-style: none;
}

.side-nav li a {
    display: block;
    padding: 15px 20px;
    color: #374151;
    text-decoration: none;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.side-nav li a:hover {
    background-color: #f3f4f6;
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 998;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.highlight {
    background-color: #fef08a;
    color: #000;
}

.char-limit {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 12px;
    color: #6b7280;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 4px;
}

.right-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stats-card {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.stats-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #374151;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-item {
    text-align: center;
    padding: 8px;
    background: white;
    border-radius: 6px;
}

.stat-number {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: #4f46e5;
}

.stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 2px;
}

.analysis-card {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.analysis-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.analysis-content {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
}

.frequency-list {
    max-height: 120px;
    overflow-y: auto;
    font-size: 11px;
}

.frequency-item {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    border-bottom: 1px solid #f3f4f6;
}

.frequency-item:last-child {
    border-bottom: none;
}

.tools-section {
    margin-bottom: 20px;
}

.search-replace {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    margin-bottom: 12px;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #4f46e5;
}

.search-btn {
    padding: 8px 16px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover {
    background: #3730a3;
}

.tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tool-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.export-section {
    display: flex;
    gap: 8px;
}

.export-btn {
    flex: 1;
    padding: 10px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.export-btn:hover {
    background: #3730a3;
}

.clear-btn {
    background: #ef4444;
}

.clear-btn:hover {
    background: #dc2626;
}

.search-results {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.language-selector {
    display: inline-block;
    margin: 0 auto;
}

.language-selector select {
    padding: 8px 32px 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 20px;
    min-width: 120px;
}

.language-selector select:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.7);
}

.language-selector select:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.language-selector select option {
    background: #4f46e5;
    color: white;
    padding: 8px;
}

@media (max-width: 768px) {
    .editor-section {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .search-replace {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .header {
        padding: 16px 12px;
    }
    
    .header h1 {
        font-size: 1.25rem;
        margin-bottom: 12px;
    }
    
    .language-selector select {
        padding: 6px 28px 6px 10px;
        font-size: 13px;
        min-width: 100px;
    }

    .main-content {
        padding: 16px;
    }

    .stats-card, .analysis-card {
        padding: 12px;
    }

    .stat-number {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .analysis-title {
        font-size: 0.8rem;
    }

    .analysis-content {
        font-size: 0.7rem;
    }

    .frequency-list {
        max-height: 100px;
    }

    .search-input {
        padding: 6px 10px;
        font-size: 13px;
    }

    .search-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    .tool-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    .export-btn {
        padding: 8px;
        font-size: 11px;
    }

    .char-limit {
        font-size: 11px;
        padding: 1px 4px;
    }

    textarea {
        padding: 12px;
        font-size: 13px;
    }

    #highlightContainer {
        padding: 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .page-container {
        padding: 5px;
    }

    .container {
        padding: 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-item {
        padding: 6px;
    }

    .header h1 {
        font-size: 1.1rem;
    }

    .language-selector select {
        min-width: 90px;
        font-size: 12px;
    }
}

/* 광고 컨테이너 스타일 */
.ad-top {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    text-align: center;
}

.ad-bottom {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    text-align: center;
}

.page-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

.left-sidebar, .right-sidebar {
    width: 160px;
    flex-shrink: 0;
}

.ad-sidebar {
    position: sticky;
    top: 20px;
    width: 100%;
    text-align: center;
}

.main-container {
    flex: 1;
    min-width: 0;
}

/* 기존 컨테이너 스타일 수정 */
.container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* 푸터 스타일 */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
    .left-sidebar, .right-sidebar {
        display: none;
    }
    
    .page-container {
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .ad-top, .ad-bottom {
        padding: 5px;
    }
    
    .container {
        padding: 15px;
    }
}

.seo-content {
    max-width: 1000px;
    margin: 40px auto;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.seo-content h2 {
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 24px;
    font-weight: 600;
}

.seo-content h3 {
    font-size: 1.25rem;
    color: #374151;
    margin: 32px 0 16px;
    font-weight: 600;
}

.seo-content h4 {
    font-size: 1.1rem;
    color: #4b5563;
    margin: 24px 0 12px;
    font-weight: 600;
}

.seo-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4b5563;
    margin-bottom: 16px;
}

.seo-content ul, .seo-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.seo-content li {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4b5563;
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .seo-content {
        margin: 24px auto;
        padding: 16px;
    }
    
    .seo-content h2 {
        font-size: 1.25rem;
    }
    
    .seo-content h3 {
        font-size: 1.1rem;
    }
    
    .seo-content h4 {
        font-size: 1rem;
    }
} 