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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Estilos para o menu de idiomas */
.language-nav {
    background: linear-gradient(135deg, #5a67d8 0%, #805ad5 100%);
    padding: 1rem 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.language-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.language-nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    border: 2px solid transparent;
}

.language-nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.language-nav a.current {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: white;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    margin-top: 20px;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

header p {
    opacity: 0.9;
}

.calculator {
    padding: 2rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.input-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

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

input.invalid {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.error-message {
    color: #e53e3e;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.calculate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-bottom: 1rem;
}

.calculate-btn:hover {
    transform: translateY(-2px);
}

.calculate-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

.examples {
    text-align: center;
}

.examples p {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.example-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.example-buttons button {
    padding: 8px 16px;
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.example-buttons button:hover {
    background: #dee2e6;
    transform: translateY(-1px);
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #667eea;
}

.results {
    padding: 2rem;
}

.result-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.result-card h3 {
    color: #667eea;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.result-content {
    display: grid;
    gap: 0.75rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.result-label {
    font-weight: 600;
    color: #495057;
}

.result-value {
    color: #667eea;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.educational {
    padding: 2rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.educational h3 {
    color: #667eea;
    margin-bottom: 1rem;
    text-align: center;
}

.concepts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.concept {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    text-align: center;
}

.concept h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.concept p {
    color: #666;
    font-size: 0.9rem;
}

.error {
    background: #fff5f5;
    color: #e53e3e;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #fed7d7;
    text-align: center;
}

.binary-representation {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    margin-top: 1rem;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .calculator, .results, .educational {
        padding: 1rem;
    }
    
    .concepts {
        grid-template-columns: 1fr;
    }
    
    .example-buttons {
        flex-direction: column;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .language-nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
}
