/* Standalone CSS for JSON to Code Generator Page */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 10px;
    color: #333;
}

body.dark-mode {
    background: #1a1a1a;
    color: #e0e0e0;
}

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loader-text {
    color: #0066cc;
    font-size: 16px;
    font-weight: 600;
    margin-top: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

body.dark-mode .page-loader {
    background: rgba(26, 26, 26, 0.95);
}

body.dark-mode .loader-spinner {
    border-color: #404040;
    border-top-color: #0066cc;
}

body.dark-mode .loader-text {
    color: #6bb6ff;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

body.dark-mode .container {
    background: #252525;
    border-color: #404040;
}

header {
    background: #ffffff;
    color: #333;
    padding: 24px 30px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
}

body.dark-mode header {
    background: #2d2d2d;
    border-bottom-color: #404040;
    color: #e0e0e0;
}

header h1 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    letter-spacing: -0.3px;
}

body.dark-mode header h1 {
    color: #e0e0e0;
}

header p {
    font-size: 11px;
    color: #666;
    margin: 0;
    font-weight: 400;
}

header p.header-description {
    display: block;
}

body.dark-mode header p {
    color: #b0b0b0;
}

.header-actions {
    position: absolute;
    top: 20px;
    right: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.dark-mode-toggle {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 11px;
    color: white;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
    backdrop-filter: blur(10px);
}

.dark-mode-toggle:hover {
    background: linear-gradient(135deg, #0052a3 0%, #0066cc 100%);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4), 0 2px 6px rgba(0, 0, 0, 0.15);
}

.dark-mode-toggle .icon {
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter: brightness(1.2);
}

.dark-mode-toggle span:not(.icon) {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* Button Styles */
button:not(.tab) {
    padding: 0px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: #2563eb;
    color: white;
    height: 34px;
}

button:not(.tab):hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

button:not(.tab):active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

button:not(.tab).secondary { background: #6c757d; }
button:not(.tab).secondary:hover { background: #5a6268; }
button:not(.tab).success { background: #28a745; }
button:not(.tab).success:hover { background: #218838; }
button:not(.tab).danger { background: #dc3545; }
button:not(.tab).danger:hover { background: #c82333; }
button:not(.tab).primary { background: #2563eb; }
button:not(.tab).primary:hover { background: #1d4ed8; }

button:not(.tab).small {
    padding: 0px 14px;
    font-size: 12px;
    font-weight: 500;
    height: 30px;
    border-radius: 6px;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

body.dark-mode button:not(.tab) {
    color: white;
}

/* Main Content */
.jc-main-content {
    padding: 20px;
}

.jc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 20px;
    flex-wrap: wrap;
}

.jc-header-left,
.jc-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

.jc-header-left { justify-content: flex-start; }
.jc-header-right { justify-content: flex-end; }

.jc-header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.jc-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    min-width: 60px;
}

body.dark-mode .jc-header h3 {
    color: #e0e0e0;
}

.jc-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0px 18px;
    font-size: 13px;
    font-weight: 600;
    height: 36px;
    border-radius: 8px;
}

.jc-btn svg { width: 16px; height: 16px; }

/* Language tabs - reuse global .tab look-and-feel */
.jc-lang-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    border-bottom: 1.5px solid #e5e7eb;
    padding-bottom: 0;
}

body.dark-mode .jc-lang-tabs {
    border-bottom-color: #404040;
}

.jc-lang-tabs .tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-radius: 0;
    height: auto;
}

.jc-lang-tabs .tab:hover {
    color: #0066cc;
    background: transparent;
    transform: none;
    box-shadow: none;
}

.jc-lang-tabs .tab.active {
    color: #0066cc;
    border-bottom-color: #0066cc;
}

body.dark-mode .jc-lang-tabs .tab {
    color: #b0b0b0;
}

body.dark-mode .jc-lang-tabs .tab.active {
    color: #6bb6ff;
    border-bottom-color: #6bb6ff;
}

.jc-container {
    display: flex;
    gap: 0;
    height: 55vh;
    min-height: 380px;
    max-height: 65vh;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: white;
}

body.dark-mode .jc-container {
    border-color: #404040;
    background: #1a1a1a;
}

.jc-editor-wrapper {
    flex: 1;
    position: relative;
    border-right: 1.5px solid #e5e7eb;
}

body.dark-mode .jc-editor-wrapper {
    border-right-color: #404040;
}

.jc-editor-wrapper:last-child { border-right: none; }

.jc-editor {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: none;
    border-radius: 0;
}

.jc-divider {
    width: 2px;
    background: #e5e7eb;
    flex-shrink: 0;
}

body.dark-mode .jc-divider {
    background: #404040;
}

.jc-error {
    margin-top: 15px;
    padding: 12px 16px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 8px;
    border: 1.5px solid #dc3545;
    font-size: 13px;
    font-weight: 500;
}

.jc-error.hidden { display: none; }

body.dark-mode .jc-error {
    background: #3d1f1f;
    color: #ffb3b3;
    border-color: #dc3545;
}

/* Toast messages */
.jc-message {
    padding: 8px 12px;
    padding-top: 28px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    width: fit-content;
    max-width: 500px;
    word-wrap: break-word;
    line-height: 1.4;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.jc-message.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.jc-message-text {
    flex: 0 1 auto;
    min-width: 0;
    padding-right: 15px;
}

.jc-message-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0px;
    right: 6px;
    line-height: 1;
    opacity: 0.8;
    text-decoration: none;
}

.jc-message-close:hover { opacity: 1; }

.jc-message.success { background: #28a745; color: white; }
.jc-message.error { background: #dc3545; color: white; }

body.dark-mode .jc-message.success { background: #1e4620; color: #90ee90; }
body.dark-mode .jc-message.error { background: #3d1f1f; color: #ffb3b3; }

/* SEO Content Section */
.seo-content-section {
    padding: 40px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
}

body.dark-mode .seo-content-section {
    background: #1a1a1a;
    border-top-color: #404040;
}

.seo-content-section h2 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

body.dark-mode .seo-content-section h2 { color: #e0e0e0; }

.seo-intro {
    font-size: 15px;
    line-height: 1.7;
    color: #666;
    margin-bottom: 30px;
}

body.dark-mode .seo-intro { color: #b0b0b0; }

.seo-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.seo-feature {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

body.dark-mode .seo-feature {
    background: #2d2d2d;
    border-color: #404040;
}

.seo-feature h3 {
    color: #0066cc;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

body.dark-mode .seo-feature h3 { color: #6bb6ff; }

.seo-feature p {
    font-size: 13px;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

body.dark-mode .seo-feature p { color: #b0b0b0; }

.seo-use-cases {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

body.dark-mode .seo-use-cases {
    background: #2d2d2d;
    border-color: #404040;
}

.seo-use-cases h3 {
    color: #0066cc;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

body.dark-mode .seo-use-cases h3 { color: #6bb6ff; }

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.use-case-item {
    background: #f8f9fa;
    padding: 18px;
    border-radius: 8px;
    border-left: 4px solid #0066cc;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.dark-mode .use-case-item {
    background: #2d2d2d;
    border-left-color: #0066cc;
}

.use-case-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.15);
}

.use-case-item h4 {
    color: #0066cc;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

body.dark-mode .use-case-item h4 { color: #6bb6ff; }

.use-case-item p {
    font-size: 13px;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

body.dark-mode .use-case-item p { color: #b0b0b0; }

/* FAQ Section (mirrors index.html look) */
.faq-section {
    padding: 40px 30px;
    border-top: 1px solid #e5e7eb;
}

body.dark-mode .faq-section { border-top-color: #404040; }

.faq-section h2 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

body.dark-mode .faq-section h2 { color: #e0e0e0; }

.faq-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 14px 18px;
    background: #fff;
}

body.dark-mode .faq-item {
    border-color: #404040;
    background: #2d2d2d;
}

.faq-question {
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

body.dark-mode .faq-question { color: #e0e0e0; }

.faq-answer p {
    font-size: 13px;
    line-height: 1.7;
    color: #666;
    margin-top: 10px;
}

body.dark-mode .faq-answer p { color: #b0b0b0; }

/* Publisher content (matches index.html defaults) */
.publisher-content {
    padding: 20px 30px;
}

.publisher-content h2 { font-size: 22px; margin-bottom: 12px; }
.publisher-content h3 { font-size: 16px; margin: 18px 0 8px; color: #0066cc; }
body.dark-mode .publisher-content h3 { color: #6bb6ff; }
.publisher-content p { font-size: 14px; line-height: 1.7; color: #444; margin-bottom: 10px; }
body.dark-mode .publisher-content p { color: #ccc; }
.publisher-content ul { margin: 0 0 10px 22px; font-size: 14px; line-height: 1.8; color: #444; }
body.dark-mode .publisher-content ul { color: #ccc; }

/* Footer Styles */
footer {
    margin-top: 30px;
    border-top: 1px solid #e5e7eb;
    color: #666;
    font-size: 12px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: left;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.footer-brand-name {
    font-weight: 700;
    color: #333;
    font-size: 15px;
}

body.dark-mode .footer-brand-name { color: #e0e0e0; }

.footer-section h4 {
    color: #333;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 600;
}

.footer-section p {
    margin: 0 0 10px 0;
    line-height: 1.6;
    color: #666;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    padding: 4px 0;
    color: #666;
    line-height: 1.5;
}

.footer-section ul li a {
    color: #0066cc;
    text-decoration: none;
}

.footer-section ul li a:hover { text-decoration: underline; }

.footer-bottom {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.footer-bottom p { margin: 0 0 15px 0; }

.footer-links {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #64748b !important;
    text-decoration: none;
    white-space: nowrap;
}

.footer-links a:hover {
    color: #a5b4fc !important;
    text-decoration: underline;
}

.footer-separator { color: #999; margin: 0 4px; }

body.dark-mode footer { border-top-color: #404040; background: #1a1a1a; }
body.dark-mode .footer-content { background: #1a1a1a; }
body.dark-mode .footer-section h4 { color: #e0e0e0; }
body.dark-mode .footer-section p,
body.dark-mode .footer-section ul li { color: #b0b0b0; }
body.dark-mode .footer-section ul li a { color: #6bb6ff; }
body.dark-mode .footer-bottom { background: #252525; border-top-color: #404040; }
body.dark-mode .footer-links a { color: #475569 !important; }
body.dark-mode .footer-links a:hover { color: #a5b4fc !important; }
body.dark-mode .footer-separator { color: #666; }

/* Responsive */
@media (max-width: 768px) {
    body { padding: 5px; }
    .container { border-radius: 0; margin: 0; max-width: 100%; }
    header { padding: 15px 15px; text-align: left; }
    header h1 { font-size: 16px; line-height: 1.3; margin-bottom: 6px; text-align: center; }
    header p { font-size: 10px; line-height: 1.4; text-align: center; }
    header p.header-description { display: none !important; }
    .header-actions { position: static; justify-content: center; margin-top: 15px; flex-wrap: wrap; gap: 10px; }
    .dark-mode-toggle { font-size: 10px; padding: 6px 12px; }

    .jc-main-content { padding: 15px 10px; }
    .jc-header { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 12px; }
    .jc-header-left, .jc-header-right { justify-content: flex-start; flex-wrap: wrap; gap: 8px; min-width: auto; }
    .jc-header h3 { font-size: 14px; min-width: auto; margin-right: 8px; }
    .jc-header-center { width: 100%; justify-content: center; order: -1; }
    .jc-btn { width: 100%; justify-content: center; padding: 8px 16px; height: auto; min-height: 35px; }

    .jc-container { flex-direction: column; height: auto; min-height: 400px; border-radius: 8px; }
    .jc-editor-wrapper { flex: 1; min-height: 220px; border-right: none; border-bottom: 1.5px solid #e5e7eb; }
    .jc-editor-wrapper:last-child { border-bottom: none; }
    body.dark-mode .jc-editor-wrapper { border-bottom-color: #404040; }
    .jc-divider { width: 100%; height: 2px; }

    .seo-content-section, .faq-section { padding: 20px 10px; }
    .seo-content-section h2, .faq-section h2 { font-size: 20px; }
    .seo-features-grid, .use-cases-grid { grid-template-columns: 1fr; gap: 15px; }

    .footer-content { grid-template-columns: 1fr; gap: 20px; padding: 20px 15px; }
    .footer-section { text-align: center; }
    .footer-section ul { text-align: left; display: inline-block; }
}
