/* Standalone CSS for Base64 Encoder/Decoder 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: #64748b; margin: 0; font-weight: 400; }
header p.header-description { display: block; }
body.dark-mode header p { color: #94a3b8; }

.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 */
.b64-main-content { padding: 20px; }

/* Mode toggle */
.b64-mode-toggle {
    display: inline-flex;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
}

.b64-mode-toggle button.b64-mode-btn {
    background: #f8f9fa;
    color: #333;
    border: none;
    border-radius: 0;
    height: 38px;
    padding: 0 22px;
    font-weight: 600;
    box-shadow: none;
}

.b64-mode-toggle button.b64-mode-btn:hover { background: #eef1f4; transform: none; box-shadow: none; }
.b64-mode-toggle button.b64-mode-btn.active { background: #2563eb; color: white; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.15); }
.b64-mode-toggle button.b64-mode-btn.active:hover { background: #1d4ed8; }

body.dark-mode .b64-mode-toggle button.b64-mode-btn { background: #252525; color: #e0e0e0; }
body.dark-mode .b64-mode-toggle button.b64-mode-btn:hover { background: #2d2d2d; }
body.dark-mode .b64-mode-toggle button.b64-mode-btn.active { background: #2563eb; color: white; }

.b64-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #f8f9fa;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
}

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

.b64-option { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: #333; cursor: pointer; }
body.dark-mode .b64-option { color: #e0e0e0; }
.b64-option input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: #0066cc; }

.b64-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 12px;
    flex-wrap: wrap;
}

.b64-panel-header h3 { margin: 0; font-size: 15px; font-weight: 600; color: #333; }
body.dark-mode .b64-panel-header h3 { color: #e0e0e0; }
.b64-panel-actions { display: flex; gap: 8px; }

.b64-textarea {
    width: 100%;
    min-height: 160px;
    padding: 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13.5px;
    line-height: 1.6;
    word-break: break-all;
    resize: vertical;
    background: #fff;
    color: #333;
    margin-bottom: 18px;
}

.b64-textarea:focus { outline: none; border-color: #0066cc; box-shadow: 0 0 0 3px rgba(0,102,204,0.12); }
body.dark-mode .b64-textarea { background: #1a1a1a; border-color: #404040; color: #e0e0e0; }

.b64-swap-row { display: flex; justify-content: center; margin: -6px 0 14px; }

.b64-swap-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8f9fa;
    color: #333;
    border: 1.5px solid #e5e7eb;
}

.b64-swap-btn:hover { background: #eef1f4; }
body.dark-mode .b64-swap-btn { background: #252525; color: #e0e0e0; border-color: #404040; }
body.dark-mode .b64-swap-btn:hover { background: #2d2d2d; }

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

.b64-error.hidden { display: none; }
body.dark-mode .b64-error { background: #3d1f1f; color: #ffb3b3; border-color: #dc3545; }

/* Toast messages */
.b64-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;
}

.b64-message.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.b64-message-text { flex: 0 1 auto; min-width: 0; padding-right: 15px; }

.b64-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;
}

.b64-message-close:hover { opacity: 1; }
.b64-message.success { background: #28a745; color: white; }
.b64-message.error { background: #dc3545; color: white; }
body.dark-mode .b64-message.success { background: #1e4620; color: #90ee90; }
body.dark-mode .b64-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 */
.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 */
.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; }

    .b64-main-content { padding: 15px 10px; }
    .b64-mode-toggle { width: 100%; }
    .b64-mode-btn { flex: 1; }
    .b64-options { flex-direction: column; align-items: flex-start; gap: 10px; }
    .b64-panel-header { flex-direction: column; align-items: stretch; gap: 8px; }
    .b64-panel-actions { flex-wrap: wrap; }

    .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; }
}
