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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
    padding: 20px;
    transition: background 0.3s ease;
}

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

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

header {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 2.5em;
    color: #222;
    flex: 1;
    font-weight: 700;
}

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

.subtitle {
    color: #888;
    font-size: 0.9em;
    margin-top: 5px;
}

.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.size-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.size-control input {
    width: 50px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

body.dark-mode .size-control input {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
}

.theme-btn, .mode-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

body.dark-mode .theme-btn, body.dark-mode .mode-btn {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
}

.theme-btn:hover, .mode-btn:hover {
    background: #f0f0f0;
}

body.dark-mode .theme-btn:hover, body.dark-mode .mode-btn:hover {
    background: #444;
}

.format-indicator {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 4px;
    font-size: 0.9em;
}

body.dark-mode .format-indicator {
    background: #1a237e;
    color: #90caf9;
}

.auto-btn {
    margin-left: 10px;
    padding: 5px 12px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85em;
}

.auto-btn:hover {
    background: #1976D2;
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.controls.hidden {
    display: none;
}

.btn-toggle {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    cursor: pointer;
    font-size: 0.95em;
    border-radius: 5px;
    transition: all 0.2s ease;
}

body.dark-mode .btn-toggle {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
}

.btn-toggle:hover {
    background: #f0f0f0;
}

body.dark-mode .btn-toggle:hover {
    background: #444;
}

.btn-toggle.active {
    background: #333;
    color: white;
    border-color: #333;
}

body.dark-mode .btn-toggle.active {
    background: #666;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.box {
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
}

body.dark-mode .box {
    background: #2a2a2a;
    border-color: #444;
}

.box-title {
    font-size: 0.9em;
    font-weight: 600;
    color: #555;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark-mode .box-title {
    color: #aaa;
}

textarea {
    width: 100%;
    min-height: 200px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    color: #333;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    resize: vertical;
    line-height: 1.5;
}

body.dark-mode textarea {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
}

textarea:focus {
    outline: none;
    border-color: #333;
}

body.dark-mode textarea:focus {
    border-color: #666;
}

.drop-zone {
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 12px;
}

body.dark-mode .drop-zone {
    border-color: #555;
}

.drop-zone.drag-over {
    border-color: #333;
    background: #f0f0f0;
}

body.dark-mode .drop-zone.drag-over {
    background: #333;
    border-color: #666;
}

.actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btn-action {
    flex: 1;
    min-width: 100px;
    padding: 10px;
    border: none;
    background: #333;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.85em;
}

.btn-action:hover {
    background: #555;
}

.btn-copy {
    background: #4caf50;
}

.btn-copy:hover {
    background: #45a049;
}

.btn-download {
    background: #2196F3;
}

.btn-download:hover {
    background: #0b7dda;
}

.btn-clear {
    background: #999;
}

.btn-clear:hover {
    background: #777;
}

.btn-file {
    padding: 10px 15px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    display: block;
    width: 100%;
    text-align: center;
    margin-bottom: 12px;
}

body.dark-mode .btn-file {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
}

.file-input {
    display: none;
}

.stats {
    margin-top: 12px;
    font-size: 0.85em;
    color: #888;
    display: flex;
    gap: 15px;
}

.stat {
    display: flex;
    gap: 5px;
}

.stat-label {
    color: #555;
    font-weight: 600;
}

body.dark-mode .stat-label {
    color: #aaa;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 0.9em;
    animation: slideInUp 0.3s ease-out;
    z-index: 1000;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.info-box {
    background: #f9f9f9;
    border-left: 3px solid #333;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    font-size: 0.9em;
    color: #666;
    line-height: 1.6;
}

body.dark-mode .info-box {
    background: #333;
    border-left-color: #666;
    color: #aaa;
}

.qr-container {
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    text-align: center;
}

body.dark-mode .qr-container {
    background: #333;
}

.qr-container h3 {
    font-size: 0.85em;
    margin-bottom: 10px;
    color: #555;
}

body.dark-mode .qr-container h3 {
    color: #aaa;
}

#qrcode {
    display: inline-block;
    padding: 10px;
    background: white;
    border-radius: 4px;
}

body.dark-mode #qrcode {
    background: #2a2a2a;
}

.image-preview {
    margin-top: 12px;
    max-height: 200px;
    border-radius: 4px;
}

.shortcuts-hint {
    margin-top: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    color: #666;
}

body.dark-mode .shortcuts-hint {
    background: #333;
    color: #aaa;
}

/* ===== TAB NAVIGATION ===== */
.tabs-container {
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
}

body.dark-mode .tabs {
    border-bottom-color: #444;
}

.tab-btn {
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 0.95em;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

body.dark-mode .tab-btn {
    color: #aaa;
}

.tab-btn:hover {
    color: #333;
}

body.dark-mode .tab-btn:hover {
    color: #e0e0e0;
}

.tab-btn.active {
    color: #333;
    border-bottom-color: #333;
}

body.dark-mode .tab-btn.active {
    color: #e0e0e0;
    border-bottom-color: #666;
}

.tab-content {
    display: none;
}

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

/* ===== CLI MODE STYLES ===== */
.cli-box {
    background: #1e1e1e;
    border: 1px solid #444;
    padding: 0;
    border-radius: 5px;
    overflow: hidden;
    font-family: 'Courier New', monospace;
}

.cli-header {
    background: #222;
    padding: 10px 15px;
    border-bottom: 1px solid #444;
}

.cli-title {
    color: #00ff00;
    font-weight: bold;
}

.cli-output {
    background: #1e1e1e;
    color: #00ff00;
    padding: 15px;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.9em;
}

.cli-line {
    margin-bottom: 8px;
    line-height: 1.4;
}

.cli-line.input {
    color: #00ff00;
}

.cli-line.output {
    color: #00dddd;
}

.cli-line.error {
    color: #ff6b6b;
}

.cli-input-area {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-top: 1px solid #444;
}

.cli-prompt {
    color: #00ff00;
    margin-right: 5px;
    font-weight: bold;
}

.cli-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #00ff00;
    outline: none;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.cli-input::placeholder {
    color: #555;
}

.cli-help {
    padding: 15px;
    background: #2a2a2a;
    border-top: 1px solid #444;
    font-size: 0.85em;
    color: #aaa;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
}

/* ===== FILE VERIFICATION STYLES ===== */
.file-info {
    padding: 12px;
    background: #f0f0f0;
    border-radius: 4px;
    margin-top: 15px;
    font-size: 0.85em;
}

body.dark-mode .file-info {
    background: #333;
    color: #aaa;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    header {
        flex-direction: column;
        gap: 15px;
    }

    h1 {
        font-size: 1.8em;
    }

    .header-controls {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .controls {
        flex-direction: column;
    }

    .btn-toggle {
        width: 100%;
    }

    .tabs {
        gap: 5px;
    }

    .tab-btn {
        padding: 10px 15px;
        font-size: 0.85em;
    }

    .cli-box {
        font-size: 0.8em;
    }

    .cli-output {
        min-height: 150px;
    }
}