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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

h1 {
    font-size: 2em;
    color: #2c3e50;
    margin-bottom: 10px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1em;
}

.lang-switcher {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 5px;
}

.lang-switcher button {
    padding: 5px 15px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.lang-switcher button.active,
.lang-switcher button:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid #ecf0f1;
}

.tab-button {
    flex: 1;
    padding: 15px;
    border: none;
    background: none;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.tab-button.active {
    color: #3498db;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #3498db;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

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

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

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.input-group input[type="text"],
.input-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-group input[type="text"]:focus,
.input-group select:focus {
    outline: none;
    border-color: #3498db;
}

.input-group input[type="range"] {
    width: calc(100% - 50px);
    vertical-align: middle;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.primary-btn {
    width: 100%;
    padding: 15px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.3s;
}

.primary-btn:hover {
    background: #2980b9;
}

.primary-btn:active {
    transform: scale(0.98);
}

.result-container {
    display: none;
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

#barcode {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
}

.download-options {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.download-btn {
    padding: 10px 20px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.download-btn:hover {
    background: #229954;
}

.scanner-container {
    display: none;
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 20px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

#video {
    width: 100%;
    height: auto;
    display: block;
}

#canvas {
    display: none;
}

#scanner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border: 2px solid #3498db;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
}

.scan-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 15px;
    border-radius: 6px;
    text-align: left;
    position: relative;
}

.scan-success p {
    margin: 5px 0;
    word-break: break-all;
}

.copy-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    transition: transform 0.2s;
}

.copy-btn:hover {
    transform: scale(1.2);
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: #7f8c8d;
    font-size: 0.9em;
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .lang-switcher {
        position: static;
        justify-content: center;
        margin-top: 15px;
    }
    
    .tab-button {
        font-size: 1em;
        padding: 12px;
    }
    
    .download-options {
        flex-direction: column;
    }
    
    .download-btn {
        width: 100%;
    }
}