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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    padding: 40px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 8px;
}

.header p {
    color: #666;
    font-size: 14px;
}

#barcodeForm {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-group {
    margin-bottom: 25px;
    width: 100%;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-generate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 40px;
    margin-top: 10px;
}

.btn-generate:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-generate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-copy {
    background: #f0f0f0;
    color: #333;
    border: 2px solid #e0e0e0;
}

.btn-copy:hover {
    background: #e0e0e0;
}

.btn-download {
    background: #4caf50;
    color: white;
}

.btn-download:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.btn-clean {
    background: #f44336;
    color: white;
}

.btn-clean:hover {
    background: #da190b;
    transform: translateY(-2px);
}

.results {
    margin-top: 34px;
    padding-top: 0px;
    display: none;
}

.results.visible {
    display: block;
    animation: slideIn 0.3s ease;
}

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

.barcode-image {
    text-align: center;
    margin: 30px 0;
}

.barcode-image img {
    max-width: 100%;
    height: auto;
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    padding: 20px;
    background: #f9f9f9;
}

.barcode-text {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.barcode-text label {
    margin-bottom: 12px;
    display: block;
}

.barcode-text p {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: #333;
    word-break: break-all;
    font-weight: 600;
}

.loading {
    text-align: center;
    display: none;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid #f0f0f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #fee;
    border: 2px solid #f44336;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.error.visible {
    display: block;
}

.success {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    color: #2e7d32;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.success.visible {
    display: block;
}

.copy-feedback {
    font-size: 12px;
    color: #4caf50;
    margin-top: 5px;
    display: none;
}

.copy-feedback.show {
    display: block;
}

.btn-validate {
    background: #2196f3;
    color: white;
}

.btn-validate:hover:not(:disabled) {
    background: #1976d2;
    transform: translateY(-2px);
}

.btn-validate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.validation-result {
    margin-top: 35px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    display: none;
    font-weight: 600;
    animation: slideIn 0.3s ease;
    line-height: 1.6;
}

.validation-result.valid {
    background: #c8e6c9;
    border: 2px solid #4caf50;
    color: #2e7d32;
    display: block;
}

.validation-result.invalid {
    background: #ffcdd2;
    border: 2px solid #f44336;
    color: #c62828;
    display: block;
}

.validation-result.loading {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    color: #1565c0;
    display: block;
}

@media (max-width: 600px) {
    .container {
        padding: 25px;
    }

    .header {
        margin-bottom: 30px;
    }

    .header h1 {
        font-size: 24px;
    }

    .form-group {
        margin-bottom: 25px;
    }

    .button-group {
        gap: 12px;
    }

    .btn-generate {
        padding: 14px 40px;
        margin-top: 10px;
    }

    .results {
        margin-top: 34px;
        padding-top: 0px;
    }

    .barcode-image {
        margin: 30px 0;
    }

    .barcode-text {
        padding: 15px;
        margin-bottom: 20px;
    }
}