/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Global Navigation */
.global-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

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

.nav-logo a {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 20px;
    margin-top: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.1);
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    margin: -2rem -2rem 3rem -2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Counter Section */
.counter-section {
    margin-bottom: 3rem;
}

.counter-container {
    background: #f8f9ff;
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid #e0e6ff;
}

.counter-container h2 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.text-input {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 2px solid #e0e6ff;
    border-radius: 10px;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s ease;
    background: white;
}

.text-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Count Results */
.count-results {
    margin-bottom: 2rem;
}

.count-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.count-item {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    border: 2px solid #e0e6ff;
    text-align: center;
    transition: transform 0.3s ease;
}

.count-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.count-item.ai-feature {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.count-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.count-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.ai-feature .count-value {
    color: white;
}

/* AI Features */
.ai-features {
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid #e0e6ff;
}

.ai-features h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature-item {
    background: #f8f9ff;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e0e6ff;
}

.feature-item h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.token-segments {
    background: white;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #e0e6ff;
    min-height: 100px;
    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

.token-segment {
    display: inline-block;
    padding: 2px 6px;
    margin: 2px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #f0f0f0;
}

.token-segment.segment-1 { background: #ffebee; border-color: #f8bbd9; }
.token-segment.segment-2 { background: #e8f5e8; border-color: #a5d6a7; }
.token-segment.segment-3 { background: #e3f2fd; border-color: #90caf9; }
.token-segment.segment-4 { background: #fff3e0; border-color: #ffcc02; }

.no-text {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.optimization-tips {
    background: white;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #e0e6ff;
}

.tip {
    color: #667eea;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

#tipsList {
    margin-left: 1rem;
}

#tipsList li {
    margin-bottom: 0.3rem;
    color: #555;
}

/* Token Count Display */
.token-count-display {
    background: white;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #e0e6ff;
}

.token-count-display .count-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    margin: 0;
}

/* SNS Limits */
.sns-limits {
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid #e0e6ff;
}

.sns-limits h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

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

.sns-item {
    background: #f8f9ff;
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid #e0e6ff;
}

.sns-item.twitter { border-left: 4px solid #000000; }
.sns-item.instagram { border-left: 4px solid #e4405f; }
.sns-item.facebook { border-left: 4px solid #1877f2; }

.sns-name {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #333;
}

.sns-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.twitter-toggle {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    cursor: pointer;
    color: #666;
}

.toggle-label input[type="radio"] {
    margin: 0;
}

.toggle-label input[type="radio"]:checked + span,
.toggle-label:has(input[type="radio"]:checked) {
    color: #000;
    font-weight: bold;
}

.sns-limit {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #667eea;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e6ff;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.twitter .progress-fill { background: #000000; }
.instagram .progress-fill { background: #e4405f; }
.facebook .progress-fill { background: #1877f2; }

/* Manuscript Conversion */
.manuscript-conversion {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid #e0e6ff;
    margin-bottom: 2rem;
}

.manuscript-conversion h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.manuscript-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.manuscript-item {
    background: #f8f9ff;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e0e6ff;
    text-align: center;
}

.manuscript-label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #666;
}

.manuscript-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

/* Guide Section */
.guide-section {
    margin-bottom: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid #e0e6ff;
}

.guide-section h2 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    border-bottom: 2px solid #e0e6ff;
    padding-bottom: 0.5rem;
}

.guide-section h3 {
    color: #764ba2;
    margin: 2rem 0 1rem 0;
    font-size: 1.4rem;
}

.guide-section h4 {
    color: #667eea;
    margin: 1.5rem 0 0.5rem 0;
    font-size: 1.2rem;
}

.guide-section p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: #444;
}

.guide-section ul, .guide-section ol {
    margin: 1rem 0 1rem 2rem;
}

.guide-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: #555;
}

.guide-content {
    max-width: none;
}

/* Example Boxes */
.example-box {
    background: #f8f9ff;
    border: 1px solid #e0e6ff;
    border-left: 4px solid #667eea;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 5px;
}

.example-box h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.example-box code {
    background: #e8f5e8;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #2e7d32;
}

/* Prompt Examples */
.prompt-example {
    background: #fff;
    border: 2px solid #e0e6ff;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.prompt-example h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.prompt-text {
    background: #f8f9ff;
    border: 1px solid #e0e6ff;
    border-radius: 5px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
}

/* Style Keywords */
.style-keywords {
    background: #f0f8ff;
    border: 1px solid #cce7ff;
    border-radius: 5px;
    padding: 1rem;
    margin: 1rem 0;
}

.style-keywords code {
    background: transparent;
    color: #0066cc;
    font-weight: 500;
}

/* Negative Prompt */
.negative-prompt {
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: 5px;
    padding: 1rem;
    margin: 1rem 0;
}

.negative-prompt h4 {
    color: #dc2626;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.negative-prompt code {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

/* Solution Boxes */
.solution {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-left: 4px solid #0ea5e9;
    border-radius: 5px;
    padding: 1rem;
    margin: 1rem 0;
}

.solution p strong {
    color: #0ea5e9;
}

/* Privacy Policy Styles */
.privacy-policy .last-updated {
    color: #666;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 2rem;
}

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

.policy-section {
    margin-bottom: 2.5rem;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid #e0e6ff;
}

.policy-section h2 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #e0e6ff;
    padding-bottom: 0.5rem;
}

.policy-section h3 {
    color: #764ba2;
    margin: 1.5rem 0 0.8rem 0;
    font-size: 1.2rem;
}

.policy-section h4 {
    color: #667eea;
    margin: 1rem 0 0.5rem 0;
    font-size: 1.1rem;
}

.contact-info {
    background: #f8f9ff;
    border: 1px solid #e0e6ff;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.policy-footer {
    background: #f8f9ff;
    border: 2px solid #e0e6ff;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    margin-top: 2rem;
}

.effective-date {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.service-name {
    color: #764ba2;
    font-weight: bold;
}

/* Ad Containers */
.ad-container {
    margin: 2rem 0;
    text-align: center;
    padding: 1rem;
    background: #f8f9ff;
    border: 1px solid #e0e6ff;
    border-radius: 8px;
}

.ad-header {
    margin-top: 0;
    margin-bottom: 2rem;
}

.ad-sidebar {
    margin: 2rem 0;
    max-width: 300px;
    float: right;
    margin-left: 2rem;
}

.ad-middle {
    margin: 3rem 0;
    clear: both;
}

.ad-footer {
    margin-bottom: 0;
    margin-top: 2rem;
    clear: both;
}

/* Footer */
.site-footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-nav {
    margin-top: 1rem;
}

.footer-nav a {
    color: #ccc;
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .main-content {
        padding: 1rem;
        margin: 1rem;
    }
    
    .page-header {
        margin: -1rem -1rem 2rem -1rem;
        padding: 1.5rem 1rem;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .count-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.8rem;
    }
    
    .count-value {
        font-size: 1.5rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .sns-grid {
        grid-template-columns: 1fr;
    }
    
    .manuscript-grid {
        grid-template-columns: 1fr;
    }
    
    .ad-sidebar {
        float: none;
        max-width: none;
        margin: 2rem 0;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .text-input {
        min-height: 150px;
    }
    
    .guide-section {
        padding: 1rem;
    }
    
    .policy-section {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .count-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        gap: 0.3rem;
    }
    
    .nav-menu a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* Animation and Transitions */
.count-item {
    transition: all 0.3s ease;
}

.count-value {
    transition: all 0.2s ease;
}

.text-input {
    transition: all 0.3s ease;
}

.progress-fill {
    transition: width 0.5s ease;
}

/* Hover Effects */
.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.sns-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.manuscript-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus States */
.text-input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.nav-menu a:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Language Switcher */
.language-switcher {
    margin-left: 1rem;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.language-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.language-btn:active {
    transform: translateY(0);
}

.language-btn .flag {
    font-size: 1rem;
}

.language-btn .lang-text {
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Language switching styles - simplified approach */

/* Language transition animation */
body {
    transition: all 0.2s ease;
}

/* Responsive Language Switcher */
@media (max-width: 768px) {
    .language-switcher {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .language-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Print Styles */
@media print {
    .global-nav,
    .ad-container,
    .site-footer {
        display: none;
    }
    
    .main-content {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
    
    .page-header {
        background: none !important;
        color: black !important;
        margin: 0;
    }
}