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

html, body {
    font-family: 'Segoe UI', sans-serif;
    font-size: 15px;
    background: #ffffff;
    color: #1a1a1a;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
}

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

html.green-mode, html.green-mode body {
    background: #3e4637;
    color: #ffffff;
}

.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    padding: 60px 32px;
    border-right: 1px solid #e0e0e0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

html.dark-mode .sidebar {
    border-right-color: #2a2a2a;
}

html.green-mode .sidebar {
    background: #4a5942;
    border-right-color: rgba(255, 255, 255, 0.3);
}

.sidebar-header {
    margin-bottom: 48px;
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    display: block;
}

html.dark-mode .logo { color: #e0e0e0; }
html.green-mode .logo { color: #ffffff; }

.nav-section {
    margin-bottom: 32px;
}

.nav-section-title {
    font-size: 12px;
    font-weight: 500;
    color: #999;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

html.dark-mode .nav-section-title { color: #666; }
html.green-mode .nav-section-title { color: #ffffff; }

.nav-links {
    list-style: none;
}

.nav-links li {
    margin-bottom: 4px;
}

.nav-links a {
    display: block;
    padding: 6px 12px;
    color: #666;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.nav-links a:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.nav-links a.active {
    background: #f5f5f5;
    color: #1a1a1a;
    font-weight: 500;
}

html.dark-mode .nav-links a { color: #999; }
html.dark-mode .nav-links a:hover { background: #2a2a2a; color: #e0e0e0; }
html.dark-mode .nav-links a.active { background: #2a2a2a; color: #e0e0e0; }

html.green-mode .nav-links a { color: #ffffff; }
html.green-mode .nav-links a:hover { background: rgba(255, 255, 255, 0.05); color: #ffffff; }
html.green-mode .nav-links a.active { background: rgba(255, 255, 255, 0.1); color: #ffffff; }

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1001;
}

.theme-toggle-btn {
    width: 52px;
    height: 52px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: black;
    padding: 0;
}

.theme-toggle-btn svg {
    display: block;
    width: 32px;
    height: 32px;
}

.theme-toggle-btn:hover {
    background: #f5f5f5;
}

html.dark-mode .theme-toggle-btn { color: white; background: transparent; }
html.dark-mode .theme-toggle-btn:hover { background: #2a2a2a; }

html.green-mode .theme-toggle-btn { color: #ffffff; background: #3e4637; }
html.green-mode .theme-toggle-btn:hover { background: #4a5942; }

.theme-dropdown {
    position: absolute;
    top: 52px;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
    min-width: 140px;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-dropdown.active {
    display: block;
}

html.dark-mode .theme-dropdown { background: #2a2a2a; border-color: #333; }
html.green-mode .theme-dropdown { background: #4a5942; border-color: #3e4637; }

.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-option:hover { background: #f5f5f5; }
html.dark-mode .theme-option:hover { background: #333; }
html.green-mode .theme-option:hover { background: rgba(255, 255, 255, 0.05); }

.theme-option.selected { border-color: #666; }

.theme-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #ccc;
}

.theme-circle.light { background: #ffffff; }
.theme-circle.dark { background: #1a1a1a; }
.theme-circle.green { background: #3e4637; }

.theme-name {
    font-size: 14px;
    color: #666;
}

html.dark-mode .theme-name { color: #999; }
html.green-mode .theme-name { color: #ffffff; }

/* Main Content */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 60px 80px;
    max-width: 900px;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1a1a1a;
}

html.dark-mode .page-title { color: #e0e0e0; }
html.green-mode .page-title { color: #ffffff; }

.subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 32px;
}

html.dark-mode .subtitle { color: #999; }
html.green-mode .subtitle { color: rgba(255, 255, 255, 0.7); }

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.tab {
    padding: 10px 20px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Segoe UI', sans-serif;
    color: #333;
    transition: all 0.2s ease;
}

.tab:hover { background: #e8e8e8; color: #1a1a1a; }
.tab.active { background: #1a1a1a; color: #ffffff; border-color: #1a1a1a; }

html.dark-mode .tab { border-color: #444; color: #b0b0b0; background: #2a2a2a; }
html.dark-mode .tab:hover { background: #333; color: #e0e0e0; }
html.dark-mode .tab.active { background: #e0e0e0; color: #1a1a1a; border-color: #e0e0e0; }

html.green-mode .tab { border-color: rgba(255, 255, 255, 0.3); color: #ffffff; background: #3e4637; }
html.green-mode .tab:hover { background: #4a5942; color: #ffffff; }
html.green-mode .tab.active { background: #4a5942; color: #ffffff; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Card */
.card {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}

html.dark-mode .card { background: #2a2a2a; border-color: #444; }
html.green-mode .card { background: #4a5942; border-color: rgba(255, 255, 255, 0.1); }

/* Form Elements */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

html.dark-mode .input-group label { color: #666; }
html.green-mode .input-group label { color: #ffffff; opacity: 0.7; }

.label-hint {
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.7;
}

textarea, input[type="text"], select {
    width: 100%;
    padding: 12px;
    font-family: 'Segoe UI', monospace;
    font-size: 14px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #1a1a1a;
    transition: border-color 0.2s ease;
}

textarea { min-height: 80px; resize: vertical; }

textarea:focus, input[type="text"]:focus, select:focus {
    outline: none;
    border-color: #666;
}

html.dark-mode textarea, html.dark-mode input[type="text"], html.dark-mode select {
    background: #1a1a1a;
    border-color: #444;
    color: #e0e0e0;
}

html.green-mode textarea, html.green-mode input[type="text"], html.green-mode select {
    background: #3e4637;
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
}

html.dark-mode select {
    background-color: #1a1a1a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

html.green-mode select {
    background-color: #3e4637;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.options-grid, .two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 450px;
}

.color-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-input-wrapper input[type="color"] {
    width: 44px;
    height: 44px;
    padding: 2px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    background: white;
}

html.dark-mode .color-input-wrapper input[type="color"] { border-color: #444; background: #1a1a1a; }
html.green-mode .color-input-wrapper input[type="color"] { border-color: rgba(255, 255, 255, 0.2); background: #3e4637; }

.color-input-wrapper input[type="text"] { flex: 1; }

/* Upload Area */
.upload-area {
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: all 0.2s ease;
    border-color: #666;
    background: rgba(0, 0, 0, 0.02);
}

.upload-area.drag-over { border-color: #666; background: rgba(0, 0, 0, 0.2); }

html.dark-mode .upload-area { border-color: #444; border-color: rgba(255, 255, 255, 0.5); background: rgba(26, 26, 26);}
html.dark-mode .upload-area.drag-over { border-color: #666; background: rgba(255, 255, 255, 0.02); }

html.green-mode .upload-area { border-color: rgba(255, 255, 255, 0.5); background: #3e4637; }
html.green-mode .upload-area.drag-over { border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.02); }

.upload-icon { color: rgba(0, 0, 0, 0.4); margin-bottom: 8px; }
.upload-main { font-size: 14px; color: rgba(0, 0, 0, 0.4); }
html.dark-mode .upload-main { color: rgba(255, 255, 255, 0.4); }
html.green-mode .upload-main { color: rgba(255, 255, 255, 0.4); }
html.dark-mode .upload-icon { color: rgba(255, 255, 255, 0.4); }
html.green-mode .upload-icon { color: rgba(255, 255, 255, 0.4); }
.upload-file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

html.dark-mode .upload-file-info { background: #1a1a1a; border-color: #444; }
html.green-mode .upload-file-info { background: #3e4637; border-color: rgba(255, 255, 255, 0.2); }

.upload-file-info svg { color: #666; flex-shrink: 0; }
html.dark-mode .upload-file-info svg { color: #999; }
html.green-mode .upload-file-info svg { color: rgba(255, 255, 255, 0.7); }

#fileName {
    flex: 1;
    font-size: 13px;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html.dark-mode #fileName { color: #e0e0e0; }
html.green-mode #fileName { color: #ffffff; }

.file-remove {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.file-remove:hover { background: #f0f0f0; color: #666; }
html.dark-mode .file-remove:hover { background: #333; color: #e0e0e0; }
html.green-mode .file-remove:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; }

/* Logo Preview */
.logo-preview {
    display: none;
    text-align: center;
    padding: 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-top: 12px;
}

.logo-preview.active { display: block; }

html.dark-mode .logo-preview { background: #1a1a1a; border-color: #444; }
html.green-mode .logo-preview { background: #3e4637; border-color: rgba(255, 255, 255, 0.2); }

.logo-preview img { max-width: 80px; max-height: 80px; border-radius: 4px; }

/* Range Input */
input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1a1a1a;
    cursor: pointer;
}

html.dark-mode input[type="range"] { background: #444; }
html.dark-mode input[type="range"]::-webkit-slider-thumb { background: #e0e0e0; }

html.green-mode input[type="range"] { background: rgba(255, 255, 255, 0.2); }
html.green-mode input[type="range"]::-webkit-slider-thumb { background: #ffffff; }

/* Buttons */
button {
    padding: 12px 24px;
    background: #f5f5f5;
    color: #1a1a1a;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Segoe UI', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover { background: #e8e8e8; }

html.dark-mode button { 
    background: #2a2a2a; 
    color: #e0e0e0; 
    border-color: #444; 
}
html.dark-mode button:hover { background: #333; }

html.green-mode button { 
    background: #4a5942; 
    color: #ffffff; 
    border-color: rgba(255, 255, 255, 0.3); 
}
html.green-mode button:hover { background: #3e4637; }

.secondary-btn {
    background: transparent;
    color: #1a1a1a;
    border: 1px solid #e0e0e0;
}

.secondary-btn:hover { background: #f5f5f5; border-color: #ccc; }

html.dark-mode .secondary-btn { 
    color: #e0e0e0; 
    border-color: #444; 
    background: transparent; 
}
html.dark-mode .secondary-btn:hover { background: #333; border-color: #555; }

html.green-mode .secondary-btn { 
    color: #ffffff; 
    border-color: rgba(255, 255, 255, 0.3); 
    background: transparent; 
}
html.green-mode .secondary-btn:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.4); }

/* Output Section */
.output-section {
    display: none;
    text-align: center;
}

.output-section.active {
    display: block;
}

.output-section h2 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 20px;
    color: #1a1a1a;
}

html.dark-mode .output-section h2 { color: #e0e0e0; }
html.green-mode .output-section h2 { color: #ffffff; }

#qrcode, #qrcode-2fa {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#qrcode canvas, #qrcode-2fa canvas,
#qrcode img, #qrcode-2fa img,
#qrcode svg, #qrcode-2fa svg {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    border-radius: 8px;
}

.button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Info Box */
.info-box {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #666;
}

html.dark-mode .info-box { background: #1a1a1a; border-color: #444; color: #999; }
html.green-mode .info-box { background: #3e4637; border-color: rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.7); }

.info-box h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #1a1a1a;
}

html.dark-mode .info-box h4 { color: #e0e0e0; }
html.green-mode .info-box h4 { color: #ffffff; }

/* Advanced Options */
.advanced-toggle { margin: 20px 0; }

.advanced-options {
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

html.dark-mode .advanced-options { border-top-color: #444; }
html.green-mode .advanced-options { border-top-color: rgba(255, 255, 255, 0.2); }

/* Toast */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    background: #1a1a1a;
    color: #ffffff;
    border-radius: 6px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show { opacity: 1; transform: translateX(0); }

.toast-success { background: #28a745; }
.toast-error { background: #dc3545; }
.toast-warning { background: #ffc107; color: #1a1a1a; }

/* Mobile */
@media (max-width: 900px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 24px; }
    .footer { margin-left: 0; padding: 24px; }
    .options-grid, .two-col-grid { grid-template-columns: 1fr; }
}

/* Mobile Navigation Styles */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    z-index: 1000;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

html.dark-mode .mobile-header {
    background: #1a1a1a;
    border-bottom-color: #2a2a2a;
}

html.green-mode .mobile-header {
    background: #4a5942;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.hamburger {
    width: 44px;
    height: 44px;
    background: transparent !important;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    transition: background 0.2s ease;
}

.hamburger:hover {
    background: #f5f5f5 !important;
}

html.dark-mode .hamburger { background: transparent !important; }
html.dark-mode .hamburger:hover { background: #2a2a2a !important; }
html.green-mode .hamburger { background: transparent !important; }
html.green-mode .hamburger:hover { background: rgba(255, 255, 255, 0.05) !important; }

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #1a1a1a;
    transition: all 0.3s ease;
}

html.dark-mode .hamburger span { background: #e0e0e0; }
html.green-mode .hamburger span { background: #ffffff; }

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-logo {
    font-family: monospace;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
}

html.dark-mode .mobile-logo { color: #e0e0e0; }
html.green-mode .mobile-logo { color: #ffffff; }

.mobile-nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 999;
    padding: 24px;
    overflow-y: auto;
}

html.dark-mode .mobile-nav {
    background: #1a1a1a;
}

html.green-mode .mobile-nav {
    background: #3e4637;
}

.mobile-nav.active {
    display: block;
}

.mobile-nav .nav-section {
    margin-bottom: 24px;
}

.mobile-nav .nav-links a {
    padding: 12px 16px;
    font-size: 16px;
}

.mobile-theme-btn {
    width: 46px;
    height: 46px;
    background: transparent !important;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.mobile-theme-btn:hover {
    background: #f5f5f5 !important;
}

.mobile-theme-btn svg {
    width: 34px;
    height: 34px;
    fill: currentColor;
}

html.dark-mode .mobile-theme-btn { color: #ffffff; background: transparent !important; }
html.dark-mode .mobile-theme-btn:hover { background: #2a2a2a !important; }
html.green-mode .mobile-theme-btn { color: #ffffff; background: transparent !important; }
html.green-mode .mobile-theme-btn:hover { background: rgba(255, 255, 255, 0.05) !important; }

@media (max-width: 900px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 24px; padding-top: 84px; }
    .theme-toggle-btn { display: none; }
    .theme-dropdown { 
        top: 60px;
        right: 12px;
    }
    .mobile-header { display: flex; }
}