body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
    color: #333;
}

/* Top Bar */
.top-bar {
    background-color: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
}

.top-bar-inner {
    width: 100%;
    max-width: 1200px;
    padding: 0 10px;
    display: flex;
    justify-content: flex-end; /* Align to right */
}

.language-selector a {
    color: #666;
    text-decoration: none;
    margin: 0 5px;
}

.language-selector a:hover {
    color: #0066cc;
    text-decoration: underline;
}

.language-selector a.active {
    font-weight: bold;
    color: #333;
}

/* Header */
.header-container {
    display: flex;
    justify-content: center;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    height: 60px;
    align-items: center;
}

.header-inner {
    display: flex;
    width: 100%;
    max-width: 1200px;
    padding: 0 10px;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
}

.logo-box {
    width: 32px;
    height: 32px;
    background-color: #0066cc;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
}

.logo-icon {
    font-size: 18px;
    color: white;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.main-nav {
    display: flex;
    gap: 30px;
}

.nav-item {
    color: #666;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.2s;
    background: none;
    padding: 0;
    display: inline-block;
}

.nav-item:hover {
    color: #0066cc;
    background: none;
    font-weight: bold;
}

/* Content Layout */
.content-wrapper {
    display: flex;
    max-width: 1200px;
    margin: 20px auto;
    gap: 20px;
    padding: 0 10px;
}

/* Sidebar */
.sidebar {
    width: 250px;
    flex-shrink: 0;
}

.sidebar-header {
    background-color: #ff6600; /* Orange/Red header */
    color: white;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    align-items: center;
    border-left: 5px solid #cc3300;
}

.sidebar-icon {
    margin-right: 10px;
    font-family: monospace;
    font-weight: bold;
    transform: rotate(90deg);
    display: inline-block;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid #ddd;
    border-top: none;
    background-color: #e8e8e8;
}

.menu-item {
    padding: 10px 15px;
    border-bottom: 1px solid #fff;
    cursor: pointer;
    transition: background-color 0.2s;
}

.menu-item:hover {
    background-color: #dcdcdc;
}

.menu-item.active {
    background-color: #d0d0d0;
    border-left: 5px solid #ff6600;
    padding-left: 10px; /* Adjust for border width */
}

/* Main Content */
.main-content {
    flex-grow: 1;
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 20px;
}

.section-header h1 {
    font-size: 24px;
    margin-top: 0;
    font-weight: normal;
    color: #333;
}

.section-header p {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Tool Workspace */
.tool-workspace {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.area-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 14px;
    color: #555;
}

.action-link {
    color: #0066cc;
    cursor: pointer;
    text-decoration: underline;
}

textarea {
    width: 100%;
    height: 150px;
    padding: 10px;
    border: 1px solid #ccc;
    font-family: monospace;
    font-size: 14px;
    box-sizing: border-box; /* Important for padding */
    resize: vertical;
}

.controls-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.action-btn {
    background-color: #0066cc; /* Blue for action */
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
}

.action-btn:hover {
    background-color: #0055aa;
}

.download-section {
    margin-top: 20px;
    text-align: right;
}

.download-btn {
    background-color: #cc0000; /* Red for download/final action */
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    width: 100%;
    display: block;
    text-align: center;
}

.download-btn:hover {
    background-color: #aa0000;
}

/* Base64 Radio Group */
.radio-group {
    display: flex;
    gap: 15px;
}

/* Image Tools Styles */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 5px;
    padding: 40px;
    text-align: center;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.upload-area:hover {
    background-color: #f0f0f0;
    border-color: #999;
}

.upload-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.upload-content p {
    margin: 0;
    color: #666;
}

.image-preview-container {
    margin-bottom: 20px;
    text-align: center;
    background-color: #f5f5f5;
    padding: 10px;
    border: 1px solid #ddd;
}

#image-preview, #result-image {
    max-width: 100%;
    max-height: 400px;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.image-info {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.image-controls {
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.control-group label {
    font-size: 14px;
    color: #333;
}

.control-group select, .control-group input {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.result-preview {
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #eee;
    background-color: #fafafa;
}

/* Barcode & QR Code Tools Styles */
.barcode-controls, .qrcode-controls {
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
}

.barcode-preview, .qrcode-preview {
    min-height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* Footer */
.site-footer {
    background-color: #333;
    color: #fff;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 5px solid #cc0000;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    font-size: 14px;
}

.footer-links {
    margin-bottom: 10px;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    margin: 0 5px;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-copyright {
    color: #aaa;
}
