:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --dark-color: #2b2d42;
    --light-color: #f8f9fa;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --border-radius: 12px;
    --box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--dark-color);
}

/* Navbar Estilizada */
.navbar {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-size: 22px;
    font-weight: 600;
    text-decoration: none;
    color: white;
}

.navbar-brand i {
    margin-right: 10px;
    font-size: 26px;
}

.navbar-links {
    display: flex;
    gap: 25px;
}

.navbar-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.navbar-link:hover {
    color: white;
    transform: translateY(-2px);
}

.navbar-link i {
    font-size: 14px;
}

/* Container Principal */
.main-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    width: 100%;
}

.container {
    width: 100%;
    max-width: 800px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: var(--transition);
}

.header {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 25px 30px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 5px;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
}

.header .icon {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 40px;
    opacity: 0.1;
}

.content {
    padding: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.btn {
    display: inline-block;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-secondary {
    background: linear-gradient(to right, #6c757d, #5a6268);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.result-container {
    margin-top: 30px;
    text-align: center;
    padding: 25px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border: 2px dashed #e9ecef;
    transition: var(--transition);
}

.result-container.active {
    border-color: var(--accent-color);
    background: rgba(72, 149, 239, 0.05);
}

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

.actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.hidden {
    display: none;
}

.settings {
    background: #f8f9fa;
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 25px;
}

.settings-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    cursor: pointer;
}

.settings-title h3 {
    font-size: 16px;
    color: var(--dark-color);
}

.settings-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.toggle-settings {
    color: var(--primary-color);
    transition: var(--transition);
}

.rotate {
    transform: rotate(180deg);
}

/* Rodapé Estilizado */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 40px 5%;
    margin-top: auto;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background: var(--accent-color);
}

.footer-section p, .footer-section a {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    display: block;
    transition: var(--transition);
    text-decoration: none;
}

.footer-section a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-section .social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.footer-section .social-links a {
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.footer-section .social-links a:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }

    .navbar-links {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .settings-content {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }

    .footer-container {
        grid-template-columns: 1fr;
    }
}

/* Animação de loading */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}